Skip to content

Commit 7de085d

Browse files
committed
Add test for address of member
1 parent de9340c commit 7de085d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
struct expr
2+
{
3+
int line;
4+
char comment;
5+
};
6+
7+
int main(int argc, char *argv[])
8+
{
9+
struct expr var_expr = {42, 'a'};
10+
struct expr other_expr = {34, 'b'};
11+
unsigned int nondet;
12+
int *ref;
13+
if(nondet)
14+
ref = &var_expr.line;
15+
else
16+
ref = &other_expr.line;
17+
__CPROVER_assert(*ref != 34, "expected failure: ref == 34");
18+
return 0;
19+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE new-smt-backend
2+
address_of.c
3+
4+
\[main\.assertion\.1\] line \d+ expected failure: ref == 34: FAILURE
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
^VERIFICATION FAILED$
8+
--
9+
--

0 commit comments

Comments
 (0)