Skip to content

Commit 7638533

Browse files
Yakir Vizelyvizel
authored andcommitted
Adding regression tests for large step encoding of CHCs
1 parent be0662b commit 7638533

File tree

531 files changed

+5572
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

531 files changed

+5572
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_test_pl_tests(
2+
"$<TARGET_FILE:cprover>"
3+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
default: test-no-p
2+
3+
include ../../../src/config.inc
4+
include ../../../src/common
5+
6+
test:
7+
@../../test.pl -e -p -c '../../../../src/cprover/cprover --large-step'
8+
9+
test-no-p:
10+
@../../test.pl -e -c '../../../../src/cprover/cprover --large-step'
11+
12+
clean:
13+
find . -name '*.out' -execdir $(RM) '{}' \;
14+
$(RM) tests.log
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
int array[10];
2+
3+
int main()
4+
{
5+
array[1l] = 10;
6+
array[2l] = 20;
7+
__CPROVER_assert(array[1l] == 10, "property 1"); // passes
8+
__CPROVER_assert(array[2l] == 20, "property 2"); // passes
9+
__CPROVER_assert(array[2l] == 30, "property 3"); // fails
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CORE
2+
array1.c
3+
--text --solve --inline --no-safety
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\(\d+\) ∀ ς : state \. S10\(ς\) ⇒ S11\(ς\[element_address\(❝array❞, .*1.*\):=10\]\)$
7+
^\(\d+\) ∀ ς : state \. S11\(ς\) ⇒ S12\(ς\[element_address\(❝array❞, .*2.*\):=20\]\)$
8+
^\(\d+\) ∀ ς : state \. S12\(ς\) ⇒ \(ς\(element_address\(❝array❞, .*1.*\)\) = 10\)$
9+
^\(\d+\) ∀ ς : state \. S13\(ς\) ⇒ \(ς\(element_address\(❝array❞, .*2.*\)\) = 20\)$
10+
^\(\d+\) ∀ ς : state \. S14\(ς\) ⇒ \(ς\(element_address\(❝array❞, .*2.*\)\) = 30\)$
11+
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
12+
^\[main\.assertion\.2\] line \d+ property 2: SUCCESS$
13+
^\[main\.assertion\.3\] line \d+ property 3: REFUTED$
14+
--
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int main()
2+
{
3+
int array[10];
4+
int i, j, k;
5+
__CPROVER_assume(i == j);
6+
__CPROVER_assert(array[i] == array[j], "property 1"); // passes
7+
__CPROVER_assert(array[i] == array[k], "property 2"); // fails
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
array2.c
3+
--text --solve --inline --no-safety
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\(\d+\) ∀ ς : state \. \(S13\(ς\) ∧ ς\(❝main::1::i❞\) = ς\(❝main::1::j❞\)\) ⇒ S14\(ς\)$
7+
^\(\d+\) ∀ ς : state \. S14\(ς\) ⇒ \(ς\(element_address\(❝main::1::array❞, (ς\(❝main::1::i❞\)|cast\(ς\(❝main::1::i❞\), signedbv\[64\]\))\)\) = ς\(element_address\(❝main::1::array❞, (ς\(❝main::1::j❞\)|cast\(ς\(❝main::1::j❞\), signedbv\[64\]\))\)\)\)$
8+
^\(\d+\) ∀ ς : state \. S15\(ς\) ⇒ \(ς\(element_address\(❝main::1::array❞, (ς\(❝main::1::i❞\)|cast\(ς\(❝main::1::i❞\), signedbv\[64\]\))\)\) = ς\(element_address\(❝main::1::array❞, (ς\(❝main::1::k❞\)|cast\(ς\(❝main::1::k❞\), signedbv\[64\]\))\)\)\)$
9+
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
10+
^\[main\.assertion\.2\] line \d+ property 2: REFUTED$
11+
--
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
int main()
2+
{
3+
int a[100];
4+
int *p = a;
5+
__CPROVER_assert(p[23] == a[23], "property 1"); // should pass
6+
return 0;
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
array4.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
7+
--
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
int array[10] = {0, 1, 2, 3, 4};
2+
3+
int main()
4+
{
5+
__CPROVER_assert(array[0l] == 0, "property 1"); // passes
6+
__CPROVER_assert(array[1l] == 1, "property 2"); // passes
7+
return 0;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
array_literal1.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main\.assertion\.1\] line \d+ property 1: SUCCESS$
7+
^\[main\.assertion\.2\] line \d+ property 2: SUCCESS$
8+
--

0 commit comments

Comments
 (0)