Skip to content

Commit c5871d7

Browse files
authored
Merge pull request #6244 from martin-cs/fix/tag-z3-regression-tests-3
Mark a test that uses --smt2 as needing the smt-backend
2 parents 9509685 + 3493061 commit c5871d7

File tree

5 files changed

+56
-12
lines changed

5 files changed

+56
-12
lines changed

regression/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ DIRS = cbmc \
4747
cbmc-primitives \
4848
goto-interpreter \
4949
cbmc-sequentialization \
50-
cpp-linter \
50+
cpp-linter \
5151
# Empty last line
5252

5353
ifeq ($(OS),Windows_NT)

regression/cbmc/issue_5952_soundness_bug_smt_encoding/test_short.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE smt-backend
22
short.c
33
--smt2
44
^EXIT=0$

regression/contracts/CMakeLists.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,40 @@ else()
44
set(is_windows false)
55
endif()
66

7+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
8+
set(gcc_only -X gcc-only)
9+
set(gcc_only_string "-X;gcc-only;")
10+
else()
11+
set(gcc_only "")
12+
set(gcc_only_string "")
13+
endif()
14+
15+
716
add_test_pl_tests(
817
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:goto-instrument> $<TARGET_FILE:cbmc> ${is_windows}"
918
)
19+
20+
## Enabling these causes a very significant increase in the time taken to run the regressions
21+
22+
#add_test_pl_profile(
23+
# "cbmc-z3"
24+
# "${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:goto-instrument> '$<TARGET_FILE:cbmc> --z3' ${is_windows}"
25+
# "-C;-X;broken-smt-backend;-X;thorough-smt-backend;-X;broken-z3-backend;-X;thorough-z3-backend;${gcc_only_string}-s;z3"
26+
# "CORE"
27+
#)
28+
29+
#add_test_pl_profile(
30+
# "cbmc-cprover-smt2"
31+
# "${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:goto-instrument> '$<TARGET_FILE:cbmc> --cprover-smt2' ${is_windows}"
32+
# "-C;-X;broken-smt-backend;-X;thorough-smt-backend;-X;broken-cprover-smt2-backend;-X;thorough-cprover-smt2-backend;${gcc_only_string}-s;cprover-smt2"
33+
# "CORE"
34+
#)
35+
36+
# solver appears on the PATH in Windows already
37+
#if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
38+
# set_property(
39+
# TEST "cbmc-cprover-smt2-CORE"
40+
# PROPERTY ENVIRONMENT
41+
# "PATH=$ENV{PATH}:$<TARGET_FILE_DIR:smt2_solver>"
42+
# )
43+
#endif()

regression/contracts/Makefile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
default: tests.log
1+
default: test
22

33
include ../../src/config.inc
44
include ../../src/common
55

66
ifeq ($(BUILD_ENV_),MSVC)
77
exe=../../../src/goto-cc/goto-cl
88
is_windows=true
9+
GCC_ONLY = -X gcc-only
910
else
1011
exe=../../../src/goto-cc/goto-cc
1112
is_windows=false
13+
GCC_ONLY =
1214
endif
1315

1416
test:
15-
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/goto-instrument/goto-instrument ../../../src/cbmc/cbmc $(is_windows)'
17+
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/goto-instrument/goto-instrument ../../../src/cbmc/cbmc $(is_windows)' -X smt-backend $(GCC_ONLY)
18+
19+
test-cprover-smt2:
20+
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/goto-instrument/goto-instrument "../../../src/cbmc/cbmc --cprover-smt2" $(is_windows)' \
21+
-X broken-smt-backend -X thorough-smt-backend \
22+
-X broken-cprover-smt-backend -X thorough-cprover-smt-backend \
23+
-s cprover-smt2 $(GCC_ONLY)
24+
25+
test-z3:
26+
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/goto-instrument/goto-instrument "../../../src/cbmc/cbmc --z3" $(is_windows)' \
27+
-X broken-smt-backend -X thorough-smt-backend \
28+
-X broken-z3-smt-backend -X thorough-z3-smt-backend \
29+
-s z3 $(GCC_ONLY)
30+
31+
tests.log: ../test.pl test
1632

17-
tests.log:
18-
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/goto-instrument/goto-instrument ../../../src/cbmc/cbmc $(is_windows)'
1933

2034
clean:
2135
@for dir in *; do \
2236
$(RM) tests.log; \
2337
if [ -d "$$dir" ]; then \
2438
cd "$$dir"; \
25-
$(RM) *.out *.gb; \
39+
$(RM) *.out *.gb *.smt2; \
2640
cd ..; \
2741
fi \
2842
done

regression/contracts/quantifiers-loop-02/test.desc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE smt-backend
1+
CORE smt-backend broken-cprover-smt-backend
22
main.c
33
--apply-loop-contracts _ --z3
44
^EXIT=0$
@@ -14,9 +14,5 @@ This test case checks the handling of a universal quantifier, with a symbolic
1414
upper bound, within a loop invariant.
1515

1616
TODO: This test should:
17-
- be tagged `smt-backend`:
18-
because the SAT backend does not support (simply ignores) `forall` in negative (e.g. assume) contexts.
19-
- be tagged `broken-cprover-smt-backend`:
20-
because the CPROVER SMT2 solver cannot handle (errors out on) `forall` in negative (e.g. assume) contexts.
2117
- not use the `_ --z3` parameters:
2218
once SMT-related tags are supported by the `Makefile`.

0 commit comments

Comments
 (0)