Skip to content

Commit 074d3be

Browse files
committed
Add extra test for address-of objects and pointer dereferencing to integers.
1 parent 142db0b commit 074d3be

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
int main()
2+
{
3+
int a = 10;
4+
int *b = &a;
5+
int c;
6+
7+
*b = 12;
8+
9+
__CPROVER_assert(a != *b, "a should be different than b");
10+
__CPROVER_assert(a == *b, "a should not be different than b");
11+
__CPROVER_assert(
12+
*b != c,
13+
"c can get assigned a value that makes it the same what b points to");
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
pointers_simple.c
3+
--trace
4+
Passing problem to incremental SMT2 solving
5+
\[main\.assertion.\d\] line \d a should be different than b: FAILURE
6+
\[main\.assertion.\d\] line \d+ a should not be different than b: SUCCESS
7+
\[main\.assertion.\d\] line \d+ c can get assigned a value that makes it the same what b points to: FAILURE
8+
c=12
9+
^EXIT=10$
10+
^SIGNAL=0$
11+
--
12+
--

0 commit comments

Comments
 (0)