File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
regression/cbmc-incr-smt2/pointers Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ #include <stdbool.h>
3+
4+ int main ()
5+ {
6+ int x ;
7+ int y ;
8+ int z ;
9+ bool nondet1 ;
10+ bool nondet2 ;
11+ int * a = nondet1 ? & x : & y ;
12+ int * b = nondet2 ? & y : & z ;
13+ __CPROVER_assert (!__CPROVER_same_object (a , b ), "Can be violated." );
14+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ pointer_object2.c
3+ --trace --verbosity 10
4+ \[main\.assertion\.1\] line 13 Can be violated.: FAILURE
5+ nondet1=FALSE
6+ nondet2=TRUE
7+ ^VERIFICATION FAILED$
8+ ^EXIT=10$
9+ ^SIGNAL=0$
10+ --
11+ --
12+ Ensure that two variables which can get assigned the address of the
13+ same object satisfy the __CPROVER_same_object predicate. In the code
14+ under test, we negate the predicate to be able to get a failure and a
15+ trace which we can then match against expected values which guide
16+ through the path that leads to the two variables getting assigned the
17+ same object.
You can’t perform that action at this time.
0 commit comments