Skip to content

Commit d60f030

Browse files
committed
Add regression tests for array write traces
1 parent 780d6cc commit d60f030

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
int main()
2+
{
3+
int example_array[1025];
4+
unsigned int index;
5+
__CPROVER_assume(index < 1025);
6+
example_array[index] = 42;
7+
__CPROVER_assert(example_array[index] == 42, "Array condition");
8+
__CPROVER_assert(example_array[index] != 42, "Array condition");
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
array_write.c
3+
--trace
4+
Passing problem to incremental SMT2 solving
5+
^Trace for main\.assertion\.2
6+
example_array\[\d{1,4}ll?\]=42
7+
^EXIT=10$
8+
^SIGNAL=0$
9+
--
10+
--
11+
Test of writing a value at a non-deterministic index of an array, then asserting
12+
the value we expect.

0 commit comments

Comments
 (0)