Skip to content

Commit e27f585

Browse files
committed
Add regression test for simple struct support
1 parent 0b734a2 commit e27f585

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <assert.h>
2+
#include <stdint.h>
3+
4+
struct my_struct_type
5+
{
6+
int16_t a;
7+
int16_t b;
8+
};
9+
10+
int main()
11+
{
12+
int16_t nondet;
13+
struct my_struct_type my_struct;
14+
if(nondet == 3)
15+
my_struct.a = 10;
16+
else
17+
my_struct.a = 12;
18+
struct my_struct_type struct_copy;
19+
struct_copy = my_struct;
20+
assert(my_struct.b != 30 || struct_copy.a != 10);
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CORE
2+
simple.c
3+
--trace
4+
Passing problem to incremental SMT2 solving
5+
line 20 assertion my_struct.b != 30 || struct_copy.a != 10: FAILURE
6+
nondet=3
7+
struct_copy.a=10
8+
struct_copy.b=30
9+
^EXIT=10$
10+
^SIGNAL=0$
11+
--
12+
--
13+
Test that we support struct values and traces for a trivial example. At the
14+
time of adding the regression test, this exercised the conversion code specific
15+
to struct_tag_typet and struct_exprt. Field sensitivity is expected to eliminate
16+
many of the struct specific expressions before they can reach the decision
17+
procedure with this simple example.

0 commit comments

Comments
 (0)