File tree Expand file tree Collapse file tree 8 files changed +112
-0
lines changed
flow-insensitive-function-call-recursive
flow-sensitive-function-call-recursive Expand file tree Collapse file tree 8 files changed +112
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ int fun (int other )
4+ {
5+ if (other > 0 )
6+ {
7+ int value = fun (other - 1 );
8+ return value + 1 ;
9+ }
10+ else
11+ {
12+ return 0 ;
13+ }
14+ }
15+
16+ int main (int argc , char * argv [])
17+ {
18+ int z = fun (0 );
19+ assert (z == 0 ); // Unknown as flow-insensitive fails to stop the recursive case being explored
20+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --variable-sensitivity --vsd-flow-insensitive --verify
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^\[main\.assertion\.1\] .* assertion z == 0: UNKNOWN$
7+ --
8+ ^warning: ignoring
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ int main (int argc , char * argv [])
4+ {
5+ int y = 1 ;
6+ int z ;
7+ if (y )
8+ {
9+ assert (y != 0 );
10+ z = 1 ;
11+ }
12+ else
13+ {
14+ assert (y == 0 );
15+ z = 0 ;
16+ }
17+ assert (z == 1 );
18+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --variable-sensitivity --vsd-flow-insensitive --verify
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^\[main\.assertion\.1\] .* assertion y != 0: SUCCESS$
7+ ^\[main\.assertion\.2\] .* assertion y == 0: FAILURE \(if reachable\)$
8+ ^\[main\.assertion\.3\] .* assertion z == 1: UNKNOWN$
9+ --
10+ ^warning: ignoring
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ int fun (int other )
4+ {
5+ if (other > 0 )
6+ {
7+ int value = fun (other - 1 );
8+ return value + 1 ;
9+ }
10+ else
11+ {
12+ return 0 ;
13+ }
14+ }
15+
16+ int main (int argc , char * argv [])
17+ {
18+ int z = fun (0 );
19+ assert (z == 0 ); // Success because flow-sensitivity blocks the branch
20+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --variable-sensitivity --verify
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^\[main\.assertion\.1\] .* assertion z == 0: SUCCESS$
7+ --
8+ ^warning: ignoring
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ int main (int argc , char * argv [])
4+ {
5+ int y = 1 ;
6+ int z ;
7+ if (y )
8+ {
9+ assert (y != 0 );
10+ z = 1 ;
11+ }
12+ else
13+ {
14+ assert (y == 0 );
15+ z = 0 ;
16+ }
17+ assert (z == 1 );
18+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --variable-sensitivity --verify
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^\[main\.assertion\.1\] .* assertion y != 0: SUCCESS$
7+ ^\[main\.assertion\.2\] .* assertion y == 0: SUCCESS \(unreachable\)$
8+ ^\[main\.assertion\.3\] .* assertion z == 1: SUCCESS$
9+ --
10+ ^warning: ignoring
You can’t perform that action at this time.
0 commit comments