Skip to content

Commit 6c6f1c9

Browse files
committed
mark some KNOWNBUG loop contracts tests as CORE
1 parent b5d22b5 commit 6c6f1c9

File tree

4 files changed

+18
-10
lines changed
  • regression/contracts
    • invar_havoc_dynamic_multi-dim_array
    • invar_havoc_dynamic_multi-dim_array_all_const_idx
    • invar_havoc_dynamic_multi-dim_array_partial_const_idx

4 files changed

+18
-10
lines changed

regression/contracts/invar_havoc_dynamic_multi-dim_array/test.desc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ to pass -- we should not mistakenly havoc the allocations, just their values.
1818
However, the `data[1][2][3] == 0` assertion is expected to fail since `data`
1919
is havoced.
2020

21-
Blocked on issue #6021 -- alias analysis is imprecise and returns `unknown`.
21+
The assigns clause in this case would have an entire 3D space,
22+
and some of it must be re-established, to the original objects
23+
but with different values at certain locations, by the loop invariant.
24+
However, currently we cannot restrict same_object for pointers
25+
within loop invariants.

regression/contracts/invar_havoc_dynamic_multi-dim_array_all_const_idx/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void main()
1717
data[4][5][6] = 0;
1818

1919
for(unsigned i = 0; i < SIZE; i++)
20-
__CPROVER_loop_invariant(i <= SIZE)
20+
__CPROVER_assigns(i, data[4][5][6]) __CPROVER_loop_invariant(i <= SIZE)
2121
{
2222
data[4][5][6] = 1;
2323
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--apply-loop-contracts
44
^EXIT=10$
55
^SIGNAL=0$
6-
^\[main.1\] .* Check loop invariant before entry: SUCCESS$
7-
^\[main.2\] .* Check that loop invariant is preserved: SUCCESS$
8-
^\[main.assertion.1\] .* assertion data\[4\]\[5\]\[6\] == 0: FAILURE$
9-
^\[main.assertion.2\] .* assertion data\[1\]\[2\]\[3\] == 0: SUCCESS$
6+
^\[main.\d+\] .* Check loop invariant before entry: SUCCESS$
7+
^\[main.\d+\] .* Check that i is assignable: SUCCESS$
8+
^\[main.\d+\] .* Check that data\[(.*)4\]\[(.*)5\]\[(.*)6\] is assignable: SUCCESS$
9+
^\[main.\d+\] .* Check that loop invariant is preserved: SUCCESS$
10+
^\[main.assertion.\d+\] .* assertion data\[4\]\[5\]\[6\] == 0: FAILURE$
11+
^\[main.assertion.\d+\] .* assertion data\[1\]\[2\]\[3\] == 0: SUCCESS$
1012
^VERIFICATION FAILED$
1113
--
1214
--
@@ -17,5 +19,3 @@ The `data[4][5][6] == 0` assertion is expected to fail since `data[4][5][6]`
1719
is havoced and the invariant does not reestablish its value.
1820
However, the `data[1][2][3] == 0` assertion is expected to pass -- we should
1921
not havoc the entire `data` array, if only a constant index if being modified.
20-
21-
Blocked on issue #6021 -- alias analysis is imprecise and returns `unknown`.

regression/contracts/invar_havoc_dynamic_multi-dim_array_partial_const_idx/test.desc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ We _could_ do a more precise analysis in future where we only havoc
1919
`data[4][5][6]` but not `data[1][2][3]` since the latter clearly cannot be
2020
modified in the given loop.
2121

22-
Blocked on issue #6021 -- alias analysis is imprecise and returns `unknown`.
22+
The assigns clause in this case would have an entire 2D grid,
23+
and some of it must be re-established, to the original objects
24+
but with different values at certain locations, by the loop invariant.
25+
However, currently we cannot restrict same_object for pointers
26+
within loop invariants.

0 commit comments

Comments
 (0)