|
1 | 1 | CORE dfcc-only
|
2 | 2 | main.c
|
3 | 3 | --dfcc main --enforce-contract foo
|
4 |
| -^\[__CPROVER_contracts_car_set_insert.assertion.\d+\] line \d+ ptr NULL or writable up to size: FAILURE$ |
5 |
| -^\[__CPROVER_contracts_car_set_insert.assertion.\d+\] line \d+ no offset bits overflow on CAR upper bound computation: FAILURE$ |
6 |
| -^\[__CPROVER_contracts_write_set_check_assignment.assertion.\d+\] line \d+ ptr NULL or writable up to size: FAILURE$ |
7 |
| -^\[__CPROVER_contracts_write_set_check_assignment.assertion.\d+\] line \d+ no offset bits overflow on CAR upper bound computation: FAILURE$ |
8 |
| -^\[foo.assigns.\d+\] line 11 Check that *x is assignable: FAILURE$ |
9 |
| -^\[foo.pointer_dereference.\d+\] line 11 dereference failure: pointer NULL in \*x: FAILURE$ |
10 |
| -^\[foo.pointer_dereference.\d+\] line 11 dereference failure: pointer invalid in \*x: FAILURE$ |
11 |
| -^\[foo.pointer_dereference.\d+\] line 11 dereference failure: deallocated dynamic object in \*x: FAILURE$ |
12 |
| -^\[foo.pointer_dereference.\d+\] line 11 dereference failure: dead object in \*x: FAILURE$ |
13 |
| -^\[foo.pointer_dereference.\d+\] line 11 dereference failure: pointer outside object bounds in \*x: FAILURE$ |
14 |
| -^\[foo.pointer_dereference.\d+\] line 11 dereference failure: invalid integer address in \*x: FAILURE$ |
| 4 | +^\[foo.assertion.\d+\] line 13 assertion 0: FAILURE$ |
| 5 | +^\[foo.assigns.\d+\] line 14 Check that \*x is assignable: SUCCESS$ |
| 6 | +^\[foo.pointer_dereference.\d+\] line 14 dereference failure: pointer NULL in \*x: SUCCESS$ |
| 7 | +^\[foo.pointer_dereference.\d+\] line 14 dereference failure: pointer invalid in \*x: SUCCESS$ |
| 8 | +^\[foo.pointer_dereference.\d+\] line 14 dereference failure: deallocated dynamic object in \*x: SUCCESS$ |
| 9 | +^\[foo.pointer_dereference.\d+\] line 14 dereference failure: dead object in \*x: SUCCESS$ |
| 10 | +^\[foo.pointer_dereference.\d+\] line 14 dereference failure: pointer outside object bounds in \*x: SUCCESS$ |
| 11 | +^\[foo.pointer_dereference.\d+\] line 14 dereference failure: invalid integer address in \*x: SUCCESS$ |
| 12 | +^\[foo.assertion.\d+\] line 16 assertion 0: FAILURE$ |
| 13 | +^\[foo.assertion.\d+\] line 17 assertion x == \(\(.*\)NULL\): SUCCESS$ |
| 14 | +^\[foo.assigns.\d+\] line 18 Check that \*y is assignable: SUCCESS$ |
| 15 | +^\[foo.pointer_dereference.\d+\] line 18 dereference failure: pointer NULL in \*y: SUCCESS$ |
| 16 | +^\[foo.pointer_dereference.\d+\] line 18 dereference failure: pointer invalid in \*y: SUCCESS$ |
| 17 | +^\[foo.pointer_dereference.\d+\] line 18 dereference failure: deallocated dynamic object in \*y: SUCCESS$ |
| 18 | +^\[foo.pointer_dereference.\d+\] line 18 dereference failure: dead object in \*y: SUCCESS$ |
| 19 | +^\[foo.pointer_dereference.\d+\] line 18 dereference failure: pointer outside object bounds in \*y: SUCCESS$ |
| 20 | +^\[foo.pointer_dereference.\d+\] line 18 dereference failure: invalid integer address in \*y: SUCCESS$ |
15 | 21 | ^EXIT=10$
|
16 | 22 | ^SIGNAL=0$
|
17 | 23 | ^VERIFICATION FAILED$
|
18 | 24 | --
|
19 | 25 | --
|
20 |
| -This test checks that when __CPROVER_is_fresh is disjunctions, |
21 |
| -the goto model accepts traces where __CPROVER_is_fresh evaluates to false |
22 |
| -and no object gets allocated, and pointers remains undefined. |
| 26 | +Illustrates the behaviour of `__CPROVER_is_fresh` under disjunctions in assume contexts. |
| 27 | +The precondition of `foo` describes a disjunction of cases, either `x` is fresh and `y` is null, |
| 28 | +or `x` is null and `y` is fresh. The function `foo` branches on `y == NULL`. |
| 29 | +The test suceeds if the two `assert(0)` in `foo` are falsifiable, which which shows |
| 30 | +that both cases of the disjunction expressed in the requires clause are reachable. |
0 commit comments