Skip to content

Commit c392312

Browse files
Full slice property regression test
1 parent e2afe93 commit c392312

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

regression/cbmc/full_slice1/main.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#include <assert.h>
2+
3+
typedef enum {
4+
A,
5+
B,
6+
C
7+
} node_t;
8+
9+
void doit(node_t *node);
10+
11+
static inline void foo(node_t *node) { }
12+
static inline void bar(node_t *node) { }
13+
14+
void doit(node_t *node)
15+
{
16+
switch (*node)
17+
{
18+
case A:
19+
foo(node);
20+
*node=B;
21+
bar(node);
22+
return;
23+
case C:
24+
*node=B;
25+
bar(node);
26+
return;
27+
}
28+
}
29+
30+
int main()
31+
{
32+
node_t node=A;
33+
34+
char count=0;
35+
while(count++<10)
36+
{
37+
char c;
38+
39+
doit(&node);
40+
41+
static char q=0;
42+
q=0;
43+
44+
if(c==0)
45+
{
46+
assert(node == A);
47+
}
48+
}
49+
50+
return 0;
51+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--full-slice --property main.assertion.1 --unwind 1
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED
7+
--
8+
^warning: ignoring

0 commit comments

Comments
 (0)