Skip to content

Commit d9fa340

Browse files
Merge pull request diffblue#267 from danpoe/fixes/dependence-graph-regression-tests
Fix dependence graph regression tests
2 parents 601a059 + cbbaa53 commit d9fa340

File tree

7 files changed

+43
-43
lines changed

7 files changed

+43
-43
lines changed

regression/goto-analyzer/dependence-graph10/test.desc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--dependence-graph --show
44
activate-multi-line-match
55
EXIT=0
66
SIGNAL=0
77
// First assignment has a control dependency on the if
8-
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 1
8+
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1 \[TRUE\]\n(.*\n){2,3}.*a = 1
99
// Second assignment has a control dependency on the if
10-
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 2
10+
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1 \[FALSE\]\n(.*\n){2,3}.*a = 2
1111
--
1212
^warning: ignoring
1313
--
@@ -19,7 +19,7 @@ dependency on the goto statement.
1919
IF !(i < 10) THEN GOTO 1
2020

2121
**** 3 file main.c line 9 function main
22-
Control dependencies: <N>
22+
Control dependencies: <N> [TRUE]
2323

2424
// 3 file main.c line 9 function main
2525
a = 1;
@@ -32,7 +32,7 @@ control dependency on the goto statement.
3232
IF !(i < 10) THEN GOTO 1
3333
...
3434
**** 5 file main.c line 13 function main
35-
Control dependencies: <N>
35+
Control dependencies: <N> [FALSE]
3636

3737
// 5 file main.c line 13 function main
3838
1: a = 2;

regression/goto-analyzer/dependence-graph11/test.desc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--dependence-graph --show
44
activate-multi-line-match
55
EXIT=0
66
SIGNAL=0
77
// Assignment has a control dependency on the if
8-
\/\/ ([0-9]+).*\n.*IF.*a < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 1
8+
\/\/ ([0-9]+).*\n.*IF.*a < 10.*THEN(.*\n)*Control dependencies: \1 \[TRUE\]\n(.*\n){2,3}.*a = 1
99
--
1010
^warning: ignoring
1111
--
@@ -17,7 +17,7 @@ dependency on the goto statement.
1717
IF !(i < 10) THEN GOTO 1
1818
...
1919
**** 3 file main.c line 9 function main
20-
Control dependencies: <N>
20+
Control dependencies: <N> [TRUE]
2121

2222
// 3 file main.c line 9 function main
2323
a = 1;
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--dependence-graph --show
44
activate-multi-line-match
55
EXIT=0
66
SIGNAL=0
77
// Assignment has a control dependency on the first if
8-
\/\/ ([0-9]+).*\n.*IF.*a < 7.*THEN(.*\n)*Control dependencies: (([0-9]+,\1)|(\1,[0-9]+))\n(.*\n){2,3}.*a = 2
8+
\/\/ ([0-9]+).*\n.*IF.*a < 7.*THEN(.*\n)*Control dependencies: (([0-9]+ \[.*\],\1 \[.*\])|(\1 \[.*\],[0-9]+ \[.*\]))\n(.*\n){2,3}.*a = 2
99
// Assignment has a control dependency on the second if
10-
\/\/ ([0-9]+).*\n.*IF.*a < 10.*THEN(.*\n)*Control dependencies: (([0-9]+,\1)|(\1,[0-9]+))\n(.*\n){2,3}.*a = 2
10+
\/\/ ([0-9]+).*\n.*IF.*a < 10.*THEN(.*\n)*Control dependencies: (([0-9]+ \[.*\],\1 \[.*\])|(\1 \[.*\],[0-9]+ \[.*\]))\n(.*\n){2,3}.*a = 2
1111
--
1212
^warning: ignoring
1313
--
1414
The first regex above matches output portions like shown below (with <N> being a
15-
location number). The intention is to check whether the assignment has a control
16-
dependency on the goto statement.
15+
location number, and <B> being TRUE or FALSE). The intention is to check whether
16+
the assignment has a control dependency on the goto statement.
1717

1818
// <N> file main.c line 9 function main
1919
IF a < 7 THEN GOTO 1
2020
...
2121
**** 6 file main.c line 19 function main
22-
Control dependencies: (<N>,...)|(...,<N>)
22+
Control dependencies: (<N> [<B>],...)|(...,<N> [<B>])
2323

2424
// 6 file main.c line 19 function main
2525
a = 2;
2626

2727
The second regex above matches output portions like shown below (with <N> being
28-
a location number). The intention is to check whether the assignment has a
29-
control dependency on the goto statement.
28+
a location number, and <B> being TRUE or FALSE). The intention is to check
29+
whether the assignment has a control dependency on the goto statement.
3030

3131
// <N> file main.c line 14 function main
3232
IF !(a < 10) THEN GOTO 2
3333
...
3434
**** 6 file main.c line 19 function main
35-
Control dependencies: (<N>,...)|(...,<N>)
35+
Control dependencies: (<N> [<B>],...)|(...,<N> [<B>])
3636

3737
// 6 file main.c line 19 function main
3838
a = 2;

regression/goto-analyzer/dependence-graph4/test.desc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--show --dependence-graph --text -
44
activate-multi-line-match
55
EXIT=0
66
SIGNAL=0
7-
\/\/ ([0-9]+) file.*\n.*IF.*g_in1.*THEN GOTO(.*\n)*Control dependencies: \1\n\n.*\n.*g_out = 1
7+
\/\/ ([0-9]+) file.*\n.*IF.*g_in1.*THEN GOTO(.*\n)*Control dependencies: \1 \[TRUE\]\n\n.*\n.*g_out = 1
88
--
99
^warning: ignoring
1010
--
@@ -16,7 +16,7 @@ dependency on the goto statement.
1616
IF !(g_in1 != 0) THEN GOTO 3
1717
...
1818
**** 3 file main.c line 9 function main
19-
Control dependencies: <N>
19+
Control dependencies: <N> [TRUE]
2020

2121
// 3 file main.c line 9 function main
2222
g_out = 1;

regression/goto-analyzer/dependence-graph7/test.desc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--dependence-graph --show
44
activate-multi-line-match
55
EXIT=0
66
SIGNAL=0
77
// Assignment has a control dependency on the loop head
8-
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 1
8+
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1 \[TRUE\]\n(.*\n){2,3}.*a = 1
99
// Backedge has a control dependency on the loop head
10-
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}\s*GOTO [0-9]+
10+
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1 \[TRUE\]\n(.*\n){2,3}\s*GOTO [0-9]+
1111
// Loop head has a control dependency on itself
12-
Control dependencies: ([0-9]+)\n(.*\n)?\n.*\/\/ \1.*\n.*IF.*i < 10.*THEN
12+
Control dependencies: ([0-9]+) \[TRUE\].*\n(.*\n)?\n.*\/\/ \1.*\n.*IF.*i < 10.*THEN
1313
--
1414
^warning: ignoring
1515
--
@@ -21,7 +21,7 @@ dependency on the loop head.
2121
1: IF !(i < 10) THEN GOTO 2
2222
...
2323
**** 3 file main.c line 8 function main
24-
Control dependencies: <N>
24+
Control dependencies: <N> [TRUE]
2525

2626
// 3 file main.c line 8 function main
2727
a = 1;
@@ -34,7 +34,7 @@ control dependency on the loop head.
3434
1: IF !(i < 10) THEN GOTO 2
3535
...
3636
**** 4 file main.c line 6 function main
37-
Control dependencies: <N>
37+
Control dependencies: <N> [TRUE]
3838

3939
// 4 file main.c line 6 function main
4040
GOTO 1
@@ -43,7 +43,7 @@ The third regex above match output portions like shown below (with <N> being a
4343
location number). The intention is to check whether the loop head has a control
4444
dependency on itself.
4545

46-
Control dependencies: <N>
46+
Control dependencies: <N> [TRUE]...
4747
Data dependencies: 1
4848

4949
// <N> file main.c line 6 function main
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--dependence-graph --show
44
activate-multi-line-match
55
EXIT=0
66
SIGNAL=0
77
// Assignment has a control dependency on the if
8-
\/\/ ([0-9]+).*\n.*IF.*i < 7.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 1
8+
\/\/ ([0-9]+).*\n.*IF.*i < 7.*THEN(.*\n)*Control dependencies: \1 \[TRUE\]\n(.*\n){2,3}.*a = 1
99
// If has a control dependency on the loop head
10-
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*i < 7
10+
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1 \[TRUE\]\n(.*\n){2,3}.*i < 7
1111
--
1212
^warning: ignoring
1313
// Assignment does not have a control dependency on the loop head
14-
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 1
14+
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1 \[.*\]\n(.*\n){2,3}.*a = 1
1515
--
1616
The first regex above matches output portions like shown below (with <N> being a
1717
location number). The intention is to check whether the assignment has a control
@@ -21,7 +21,7 @@ dependency on the if.
2121
1: IF !(i < 7) THEN GOTO 2
2222
...
2323
**** 3 file main.c line 8 function main
24-
Control dependencies: <N>
24+
Control dependencies: <N> [TRUE]
2525

2626
// 3 file main.c line 8 function main
2727
a = 1;
@@ -34,21 +34,21 @@ dependency on the loop head.
3434
1: IF !(i < 10) THEN GOTO 3
3535

3636
**** 3 file main.c line 8 function main
37-
Control dependencies: <N>
37+
Control dependencies: <N> [TRUE]
3838
Data dependencies: 1
3939

4040
// 3 file main.c line 8 function main
4141
IF !(i < 7) THEN GOTO 2
4242

4343
The third regex above matches output portions like shown below (with <N> being a
44-
location number). The intention is to check that the assignment does not have a
45-
control dependency on the loop head.
44+
location number, and <B> being a boolean). The intention is to check that the
45+
assignment does not have a control dependency on the loop head.
4646

4747
// <N> file main.c line 6 function main
4848
1: IF !(i < 10) THEN GOTO 3
4949
...
5050
**** 4 file main.c line 10 function main
51-
Control dependencies: <N>
51+
Control dependencies: <N> [<B>]
5252

5353
// 4 file main.c line 10 function main
5454
a = 1;
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--dependence-graph --show
44
activate-multi-line-match
55
EXIT=0
66
SIGNAL=0
77
// Second assignment has a control dependency on the outer if
8-
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 2
8+
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1 \[TRUE\]\n(.*\n){2,3}.*a = 2
99
--
1010
^warning: ignoring
1111
// Second assignment does not have a control dependency on the inner if
12-
\/\/ ([0-9]+).*\n.*IF.*i < 7.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 2
12+
\/\/ ([0-9]+).*\n.*IF.*i < 7.*THEN(.*\n)*Control dependencies: \1 \[.*\]\n(.*\n){2,3}.*a = 2
1313
--
1414
The first regex above matches output portions like shown below (with <N> being a
1515
location number). The intention is to check whether the assignment has a control
@@ -19,20 +19,20 @@ dependency on the outer if.
1919
IF !(i < 10) THEN GOTO 2
2020
...
2121
**** 6 file main.c line 14 function main
22-
Control dependencies: <N>
22+
Control dependencies: <N> [TRUE]
2323

2424
// 6 file main.c line 14 function main
2525
a = 2;
2626

2727
The second regex above matches output portions like shown below (with <N> being
28-
a location number). The intention is to check that the assignment does not have
29-
a control dependency on the inner if.
28+
a location number, and <B> being a boolean). The intention is to check that the
29+
assignment does not have a control dependency on the inner if.
3030

3131
// <N> file main.c line 9 function main
3232
IF !(i < 7) THEN GOTO 1
3333
...
3434
**** 6 file main.c line 14 function main
35-
Control dependencies: <N>
35+
Control dependencies: <N> [<B>]
3636

3737
// 6 file main.c line 14 function main
3838
a = 2;

0 commit comments

Comments
 (0)