Skip to content

Commit d4d3aa1

Browse files
committed
Add an extra test to the regression test suite, suggested by Thomas S.
1 parent f02ee6a commit d4d3aa1

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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.

0 commit comments

Comments
 (0)