CORE
main.c
--dependence-graph --show
activate-multi-line-match
EXIT=0
SIGNAL=0
// Assignment has a control dependency on the if
\/\/ ([0-9]+).*\n.*IF.*i < 7.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 1
// If has a control dependency on the loop head
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*i < 7
--
^warning: ignoring
// Assignment does not have a control dependency on the loop head
\/\/ ([0-9]+).*\n.*IF.*i < 10.*THEN(.*\n)*Control dependencies: \1\n(.*\n){2,3}.*a = 1
--
The first regex above matches output portions like shown below (with <N> being a
location number). The intention is to check whether the assignment has a control
dependency on the if.

        // <N> file main.c line 6 function main
     1: IF !(i < 7) THEN GOTO 2
...
**** 3 file main.c line 8 function main
Control dependencies: <N>

        // 3 file main.c line 8 function main
        a = 1;

The second regex above matches output portions like shown below (with <N> being
a location number). The intention is to check whether the if has a control
dependency on the loop head.

        // <N> file main.c line 6 function main
     1: IF !(i < 10) THEN GOTO 3

**** 3 file main.c line 8 function main
Control dependencies: <N>
Data dependencies: 1

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

The third regex above matches output portions like shown below (with <N> being a
location number). The intention is to check that the assignment does not have a
control dependency on the loop head.

        // <N> file main.c line 6 function main
     1: IF !(i < 10) THEN GOTO 3
...
**** 4 file main.c line 10 function main
Control dependencies: <N>

        // 4 file main.c line 10 function main
        a = 1;
