File tree Expand file tree Collapse file tree 11 files changed +41
-32
lines changed
assigns_enforce_scoping_01
assigns_type_checking_valid_cases
history-pointer-enforce-10
quantifiers-exists-requires-enforce
quantifiers-forall-ensures-enforce
quantifiers-forall-requires-enforce
test_array_memory_enforce
src/goto-instrument/contracts Expand file tree Collapse file tree 11 files changed +41
-32
lines changed Original file line number Diff line number Diff line change
1
+ void foo (int * xp ) __CPROVER_assigns (* xp )
2
+ {
3
+ {
4
+ int y ;
5
+ y = 2 ;
6
+ }
7
+ int z = 3 ;
8
+ * xp = 1 ;
9
+ }
10
+
11
+ int main ()
12
+ {
13
+ int * xp = malloc (sizeof (* xp ));
14
+ foo (xp );
15
+ return 0 ;
16
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --enforce-all-contracts
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION SUCCESSFUL$
7
+ --
8
+ --
9
+ Checks whether verification fails when enforcing a contract
10
+ for functions, without assigns clauses, that modify an input.
Original file line number Diff line number Diff line change 3
3
--enforce-all-contracts
4
4
^EXIT=10$
5
5
^SIGNAL=0$
6
- ^\[f1.\d+\] line \d+ Check that f1\$\$1\$\$1\$\$b is assignable: SUCCESS$
7
6
^\[f1.\d+\] line \d+ Check that \*f1\$\$1\$\$1\$\$b is assignable: SUCCESS$
8
7
^\[f1.\d+\] line \d+ Check that \*b is assignable: FAILURE$
9
8
^VERIFICATION FAILED$
Original file line number Diff line number Diff line change 5
5
^SIGNAL=0$
6
6
^\[foo1.\d+\] line \d+ Check that a is assignable: SUCCESS$
7
7
^\[foo10.\d+\] line \d+ Check that buffer\-\>len is assignable: SUCCESS$
8
+ ^\[foo10.\d+\] line \d+ Check that buffer\-\>aux\.allocated is assignable: SUCCESS$
8
9
^\[foo2.\d+\] line \d+ Check that b is assignable: SUCCESS$
9
10
^\[foo3.\d+\] line \d+ Check that b is assignable: SUCCESS$
10
11
^\[foo3.\d+\] line \d+ Check that y is assignable: SUCCESS$
27
28
^\[foo8.\d+\] line \d+ Check that array\[\(.* int\)7\] is assignable: SUCCESS$
28
29
^\[foo8.\d+\] line \d+ Check that array\[\(.* int\)8\] is assignable: SUCCESS$
29
30
^\[foo8.\d+\] line \d+ Check that array\[\(.* int\)9\] is assignable: SUCCESS$
30
- ^\[foo9.\d+\] line \d+ Check that new_array is assignable: SUCCESS$
31
31
^\[foo9.\d+\] line \d+ Check that array is assignable: SUCCESS$
32
32
^VERIFICATION SUCCESSFUL$
33
33
--
Original file line number Diff line number Diff line change 4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
\[postcondition.\d+\] file main.c line \d+ Check ensures clause: SUCCESS
7
- \[foo.\d+\] line \d+ Check that sum is assignable: SUCCESS
8
7
\[main.assertion.\d+\] line \d+ assertion foo\(\&x, \&y\) \=\= 10: SUCCESS
9
8
^VERIFICATION SUCCESSFUL$
10
9
--
Original file line number Diff line number Diff line change 7
7
^\[postcondition.\d+\] file main.c line \d+ Check ensures clause\: SUCCESS$
8
8
^\[postcondition.\d+\] file main.c line \d+ Check ensures clause\: SUCCESS$
9
9
^\[bar.\d+\] line \d+ Check that p\-\>y is assignable\: SUCCESS$
10
- ^\[baz.\d+\] line \d+ Check that pp is assignable\: SUCCESS$
11
- ^\[baz.\d+\] line \d+ Check that empty is assignable\: SUCCESS$
12
10
^\[baz.\d+\] line \d+ Check that p is assignable\: SUCCESS$
13
11
^\[baz.\d+\] line \d+ Check that p is assignable\: SUCCESS$
14
12
^\[foo.\d+\] line \d+ Check that \*p\-\>y is assignable\: SUCCESS$
Original file line number Diff line number Diff line change 4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
^\[postcondition.\d+\] file main.c line \d+ Check ensures clause: SUCCESS$
7
- ^\[f1.\d+\] line \d+ Check that found\_four is assignable: SUCCESS$
8
- ^\[f1.\d+\] line \d+ Check that i is assignable: SUCCESS$
9
- ^\[f1.\d+\] line \d+ Check that i is assignable: SUCCESS$
10
- ^\[f1.\d+\] line \d+ Check that found\_four is assignable: SUCCESS$
11
7
^VERIFICATION SUCCESSFUL$
12
8
--
13
9
^warning: ignoring
Original file line number Diff line number Diff line change 4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
^\[postcondition.\d+\] file main.c line \d+ Check ensures clause: SUCCESS$
7
- ^\[f1.\d+\] line \d+ Check that i is assignable: SUCCESS$
8
- ^\[f1.\d+\] line \d+ Check that i is assignable: SUCCESS$
9
7
^\[f1.\d+\] line \d+ Check that arr\[\(.*\)i\] is assignable: SUCCESS$
10
8
^VERIFICATION SUCCESSFUL$
11
9
--
Original file line number Diff line number Diff line change 4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
^\[postcondition.\d+\] file main.c line \d+ Check ensures clause: SUCCESS$
7
- ^\[f1.\d+\] line \d+ Check that is\_identity is assignable: SUCCESS$
8
- ^\[f1.\d+\] line \d+ Check that i is assignable: SUCCESS$
9
- ^\[f1.\d+\] line \d+ Check that i is assignable: SUCCESS$
10
- ^\[f1.\d+\] line \d+ Check that is\_identity is assignable: SUCCESS$
11
7
^VERIFICATION SUCCESSFUL$
12
8
--
13
9
^warning: ignoring
Original file line number Diff line number Diff line change 7
7
\[foo.\d+\] line \d+ Check that \*x is assignable: SUCCESS
8
8
\[foo.\d+\] line \d+ Check that x\[\(.* int\)5\] is assignable: SUCCESS
9
9
\[foo.\d+\] line \d+ Check that x\[\(.* int\)9\] is assignable: SUCCESS
10
- \[foo.\d+\] line \d+ Check that y is assignable: SUCCESS
11
10
^VERIFICATION SUCCESSFUL$
12
11
--
13
12
--
You can’t perform that action at this time.
0 commit comments