Skip to content

Commit 010090b

Browse files
committed
Add regression test
1 parent bb590f6 commit 010090b

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
int main()
2+
{
3+
int example_array[] = {5, 4, 3, 2, 1};
4+
unsigned int index;
5+
__CPROVER_assume(index < 5);
6+
__CPROVER_assert(example_array[index] != 42, "Non-existent element");
7+
__CPROVER_assert(example_array[index] != 5, "Index 0");
8+
__CPROVER_assert(example_array[index] != 4, "Index 1");
9+
__CPROVER_assert(example_array[index] != 3, "Index 2");
10+
__CPROVER_assert(example_array[index] != 2, "Index 3");
11+
__CPROVER_assert(example_array[index] != 1, "Index 4");
12+
__CPROVER_assert(example_array[index] == 5 - index, "Index value relation");
13+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CORE
2+
array_literal.c
3+
4+
Passing problem to incremental SMT2 solving
5+
line \d+ Non-existent element: SUCCESS
6+
line \d+ Index 0: FAILURE
7+
line \d+ Index 1: FAILURE
8+
line \d+ Index 2: FAILURE
9+
line \d+ Index 3: FAILURE
10+
line \d+ Index 4: FAILURE
11+
line \d+ Index value relation: SUCCESS
12+
^EXIT=10$
13+
^SIGNAL=0$
14+
--
15+
--
16+
Test of reading an array which is initialised using an array literal.

0 commit comments

Comments
 (0)