File tree 2 files changed +32
-0
lines changed
regression/cbmc-incr-smt2/pointers
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ int main ()
2
+ {
3
+ int a ;
4
+ int * p = & a ;
5
+ int * q = & a ;
6
+
7
+ __CPROVER_assert (
8
+ __CPROVER_POINTER_OFFSET (p ) != __CPROVER_POINTER_OFFSET (q ),
9
+ "expected failure because offsets should be the same" );
10
+
11
+ // TODO: Remove comments once pointer arithmetic works:
12
+
13
+ // *q = p + 2;
14
+
15
+ // __CPROVER_assert(__CPROVER_POINTER_OFFSET(p) != __CPROVER_POINTER_OFFSET(q), "expected failure");
16
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ pointer_offset.c
3
+ --trace
4
+ \[main\.assertion\.1\] line \d+ expected failure because offsets should be the same: FAILURE
5
+ ^VERIFICATION FAILED$
6
+ ^EXIT=10$
7
+ ^SIGNAL=0$
8
+ --
9
+ --
10
+ Test that the pointer offset bits of two pointers pointing to
11
+ the same object are equal.
12
+
13
+ The test also contains a fragment of the test which doesn't work
14
+ for now, but would be good to be added as soon as we get pointer
15
+ arithmetic to work, so we can make sure that pointer offset fails
16
+ appropriately.
You can’t perform that action at this time.
0 commit comments