File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
regression/contracts/loop-freeness-check Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ // clang-format off
2
+ int foo (int * arr )
3
+ __CPROVER_assigns (* arr )
4
+ // clang-format on
5
+ {
6
+ for (int i = 0 ; i < 10 ; i ++ )
7
+ arr [i ] = i ;
8
+
9
+ return 0 ;
10
+ }
11
+
12
+ int main ()
13
+ {
14
+ int arr [10 ];
15
+ foo (arr );
16
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --enforce-contract foo
4
+ ^--- begin invariant violation report ---$
5
+ ^Invariant check failed$
6
+ ^Condition: is_loop_free\(goto_program\)$
7
+ ^Reason: Loops remain in function 'foo', assigns clause checking instrumentation cannot be applied\.$
8
+ ^EXIT=134$
9
+ ^SIGNAL=0$
10
+ --
11
+ --
12
+ This test checks that loops that remain in the program when attempting to
13
+ instrument assigns clauses are detected and trigger an INVARIANT.
You can’t perform that action at this time.
0 commit comments