Skip to content

Commit 95aa842

Browse files
Enrico SteffinlongoNlightNFotis
Enrico Steffinlongo
authored andcommitted
Add regression tests for --export-symex-ready-goto
1 parent 753311a commit 95aa842

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

regression/cbmc/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
22
set(gcc_only -X gcc-only)
33
set(gcc_only_string "-X;gcc-only;")
4+
set(exclude_win_broken_tests -X winbug)
5+
set(exclude_win_broken_tests_string "-X;winbug;")
46
else()
57
set(gcc_only "")
68
set(gcc_only_string "")
9+
set(exclude_win_broken_tests "")
10+
set(exclude_win_broken_tests_string "")
711
endif()
812

913
add_test_pl_tests(
10-
"$<TARGET_FILE:cbmc> --validate-goto-model --validate-ssa-equation" -X smt-backend ${gcc_only}
14+
"$<TARGET_FILE:cbmc> --validate-goto-model --validate-ssa-equation" -X smt-backend ${gcc_only} ${exclude_win_broken_tests}
1115
)
1216

1317
add_test_pl_profile(
1418
"cbmc-paths-lifo"
1519
"$<TARGET_FILE:cbmc> --paths lifo"
16-
"-C;-X;thorough-paths;-X;smt-backend;-X;paths-lifo-expected-failure;${gcc_only_string}-s;paths-lifo"
20+
"-C;-X;thorough-paths;-X;smt-backend;-X;paths-lifo-expected-failure;${gcc_only_string}-s;paths-lifo;${exclude_win_broken_tests_string}"
1721
"CORE"
1822
)
1923

2024
add_test_pl_profile(
2125
"cbmc-cprover-smt2"
2226
"$<TARGET_FILE:cbmc> --cprover-smt2"
23-
"-C;-X;broken-smt-backend;-X;thorough-smt-backend;-X;broken-cprover-smt-backend;-X;thorough-cprover-smt-backend;${gcc_only_string}-s;cprover-smt2"
27+
"-C;-X;broken-smt-backend;-X;thorough-smt-backend;-X;broken-cprover-smt-backend;-X;thorough-cprover-smt-backend;${gcc_only_string}-s;cprover-smt2;${exclude_win_broken_tests_string}"
2428
"CORE"
2529
)
2630

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CORE winbug
2+
test.c
3+
--export-symex-ready-goto ""
4+
^ERROR: Please provide a filename to write the goto-binary to.$
5+
^EXIT=6$
6+
^SIGNAL=0$
7+
--
8+
--
9+
Ensure that --export-symex-ready-goto exported.symex-ready.goto terminates
10+
with error when incorrectly used.
11+
12+
The reason why we use `winbug` is that it fails on certain windows system
13+
probably due to different interpretation of "". Not a bug, but we're using
14+
that label to remain consistent with other parts of the codebase, and not
15+
to unnecessarily introduce new ones for simple use cases.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CORE
2+
test.c
3+
--export-symex-ready-goto exported.symex.ready.goto
4+
^Parsing test.c$
5+
^Converting$
6+
^Type-checking test$
7+
^Generating GOTO Program$
8+
^Removal of function pointers and virtual functions$
9+
^Generic Property Instrumentation$
10+
Exported goto-program in symex-ready-goto form at exported.symex.ready.goto
11+
^EXIT=0$
12+
^SIGNAL=0$
13+
--
14+
--
15+
Ensure that --export-symex-ready-goto exported.symex.ready.goto terminates successfully and logs this.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int main(int argc, char **argv)
2+
{
3+
int arr[] = {0, 1, 2, 3, 4};
4+
__CPROVER_assert(arr[0] == 1, "expected failure: 0 != 1");
5+
return 0;
6+
}

0 commit comments

Comments
 (0)