Skip to content

Commit 7dc7632

Browse files
committed
Add test that Z3 solver support is present and working
This confirms that Z3 is present and working in CI, as well as that cbmc's support for Z3 is not entirely broken.
1 parent 1bb8466 commit 7dc7632

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

regression/cbmc/z3/invalid.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <assert.h>
2+
3+
int main()
4+
{
5+
unsigned int non_det;
6+
assert(non_det * non_det != 9u);
7+
return 0;
8+
}

regression/cbmc/z3/invalid.desc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CORE
2+
invalid.c
3+
--trace --smt2 --z3
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
line 6 assertion non_det \* non_det != 9u: FAILURE
7+
non_det=\d+u
8+
VERIFICATION FAILED
9+
--
10+
line 6 assertion non_det \* non_det != 9u: ERROR
11+
error running SMT2 solver
12+
--
13+
Run cbmc with the --z3 option to confirm that support for the Z3 solver is
14+
available and working for an invalid program where the assertion may fail.

regression/cbmc/z3/valid.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <assert.h>
2+
3+
int main()
4+
{
5+
unsigned int non_det;
6+
assert(non_det * non_det != 12u);
7+
return 0;
8+
}

regression/cbmc/z3/valid.desc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CORE
2+
valid.c
3+
--trace --smt2 --z3
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
line 6 assertion non_det \* non_det != 12u: SUCCESS
7+
VERIFICATION SUCCESSFUL
8+
--
9+
line 6 assertion non_det \* non_det != 12u: ERROR
10+
error running SMT2 solver
11+
--
12+
Run cbmc with the --z3 option to confirm that support for the Z3 solver is
13+
available and working for a valid program.

0 commit comments

Comments
 (0)