Skip to content

Commit d125b1a

Browse files
committed
Add regression tests for array output with z3
Add two regression tests to check for array output in traces.
1 parent eec9850 commit d125b1a

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

regression/cbmc/z3/trace-char.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
void main(int argc, char **argv)
2+
{
3+
char arr[] = {'0', '1', '2', '3', '4', '5', '6', '7'};
4+
assert(arr[0] == '2');
5+
}

regression/cbmc/z3/trace-char.desc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CORE smt-backend broken-cprover-smt-backend
2+
trace-char.c
3+
--trace --smt2 --z3
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
arr=\{ arr
7+
arr=\{ '0', '1', '2', '3', '4', '5', '6', '7' \}
8+
--
9+
arr=(assignment removed)
10+
error running SMT2 solver
11+
--
12+
Run cbmc with the --z3 and --trace options with arrays to confirm that
13+
char arrays are displayed in traces.

regression/cbmc/z3/trace.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
void main(int argc, char **argv)
2+
{
3+
int arr[] = {0, 1, 2, 3, 4, 5, 6, 17};
4+
assert(arr[0] == 2);
5+
}

regression/cbmc/z3/trace.desc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CORE smt-backend broken-cprover-smt-backend
2+
trace.c
3+
--trace --smt2 --z3
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
arr=\{ arr
7+
arr=\{ 0, 1, 2, 3, 4, 5, 6, 17 \}
8+
--
9+
arr=(assignment removed)
10+
error running SMT2 solver
11+
--
12+
Run cbmc with the --z3 and --trace options with arrays to confirm that
13+
int arrays are displayed in traces.

0 commit comments

Comments
 (0)