File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed
regression/cbmc-cover/location-assume Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ void main ()
4+ {
5+ int i ;
6+ int * p = & i ;
7+ int j ;
8+ __CPROVER_assume (j == 1 / (* p ));
9+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ end.c
3+ --pointer-check --div-by-zero-check --cover location
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^\[main.coverage.1\] file end.c line 5 function main block 1 \(lines end\.c:main:5-8\): SATISFIED$
7+ ^\[main.coverage.2\] file end.c line 9 function main block 2 \(lines end\.c:main:9\): SATISFIED$
8+ ^\*\* 2 of 2 covered \(100.0%\)
9+ --
10+ ^warning: ignoring
11+ --
12+ Test that in the case where multiple assertions are added on the same line of
13+ code due to the addition of instrumentation checks, these do not result in
14+ further splitting blocks.
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ int main ()
4+ {
5+ int i ;
6+ int j ;
7+ j = i ;
8+ __CPROVER_assume (0 );
9+ j = i + 2 ;
10+ return 0 ;
11+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ middle.c
3+ --cover location
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^\[main.coverage.1\] file middle.c line 5 function main block 1 \(lines middle\.c:main:5-8\): SATISFIED$
7+ ^\[main.coverage.2\] file middle.c line 9 function main block 2 \(lines middle\.c:main:9-11\): FAILED$
8+ ^\*\* 1 of 2 covered \(50.0%\)
9+ --
10+ ^warning: ignoring
11+ --
12+ This test confirms that assumptions in the middle of what would otherwise be a
13+ single blocks without control flow will cause the code to be split into 2
14+ coverage blocks. This is required as an unsatisfiable assumption can result in
15+ the following statements being unreachable.
You can’t perform that action at this time.
0 commit comments