|
| 1 | +CORE |
| 2 | +main.c |
| 3 | +--dependence-graph --show |
| 4 | +activate-multi-line-match |
| 5 | +EXIT=0 |
| 6 | +SIGNAL=0 |
| 7 | +// 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 |
| 9 | +// 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 |
| 11 | +-- |
| 12 | +^warning: ignoring |
| 13 | +// 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 |
| 15 | +-- |
| 16 | +The first regex above matches output portions like shown below (with <N> being a |
| 17 | +location number). The intention is to check whether the assignment has a control |
| 18 | +dependency on the if. |
| 19 | + |
| 20 | + // <N> file main.c line 6 function main |
| 21 | + 1: IF !(i < 7) THEN GOTO 2 |
| 22 | +... |
| 23 | +**** 3 file main.c line 8 function main |
| 24 | +Control dependencies: <N> |
| 25 | + |
| 26 | + // 3 file main.c line 8 function main |
| 27 | + a = 1; |
| 28 | + |
| 29 | +The second regex above matches output portions like shown below (with <N> being |
| 30 | +a location number). The intention is to check whether the if has a control |
| 31 | +dependency on the loop head. |
| 32 | + |
| 33 | + // <N> file main.c line 6 function main |
| 34 | + 1: IF !(i < 10) THEN GOTO 3 |
| 35 | + |
| 36 | +**** 3 file main.c line 8 function main |
| 37 | +Control dependencies: <N> |
| 38 | +Data dependencies: 1 |
| 39 | + |
| 40 | + // 3 file main.c line 8 function main |
| 41 | + IF !(i < 7) THEN GOTO 2 |
| 42 | + |
| 43 | +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. |
| 46 | + |
| 47 | + // <N> file main.c line 6 function main |
| 48 | + 1: IF !(i < 10) THEN GOTO 3 |
| 49 | +... |
| 50 | +**** 4 file main.c line 10 function main |
| 51 | +Control dependencies: <N> |
| 52 | + |
| 53 | + // 4 file main.c line 10 function main |
| 54 | + a = 1; |
0 commit comments