File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
regression/goto-analyzer/variable-sensitivity-assign-aware-merge-non-terminating-function Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ int non_terminating (int * a , int val )
2+ {
3+ while (1 )
4+ {
5+ a = val ;
6+ }
7+ return a ;
8+ }
9+
10+ int non_terminating_extra (int * a , int val )
11+ {
12+ while (1 )
13+ {
14+ a = val ;
15+ }
16+ return a ;
17+ }
18+
19+ void test_non_terminating ()
20+ {
21+ int one_val = 5 ;
22+ int second_val = 6 ;
23+ __CPROVER_assert (one_val == 5 , "one_val==5" );
24+ __CPROVER_assert (second_val == 6 , "second_val==6" );
25+
26+ non_terminating (& one_val , 10 );
27+ __CPROVER_assert (one_val == 10 , "one_val==10" );
28+ non_terminating_extra (& second_val , 12 );
29+ __CPROVER_assert (second_val == 12 , "second_val==12" );
30+ non_terminating_extra (& second_val , 13 );
31+ __CPROVER_assert (second_val == 13 , "second_val==13" );
32+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --function test_non_terminating --variable --pointers --arrays --structs --verify
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ [test_non_terminating.assertion.1] .* one_val==5: Success
7+ [test_non_terminating.assertion.2] .* second_val==6: Success
8+ [test_non_terminating.assertion.3] .* one_val==10: Success \(unreachable\)
9+ [test_non_terminating.assertion.4] .* second_val==12: Success \(unreachable\)
10+ [test_non_terminating.assertion.5] .* second_val==13: Success \(unreachable\)
11+ --
You can’t perform that action at this time.
0 commit comments