Skip to content

Commit 1e26b7f

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

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

regression/cbmc/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
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+
# We add the string at the end of the exclusion list, so it must not
6+
# have the `;` at the end or it bugs out.
7+
set(exclude_win_broken_tests_string "-X;winbug")
48
else()
59
set(gcc_only "")
610
set(gcc_only_string "")
11+
set(exclude_win_broken_tests "")
12+
set(exclude_win_broken_tests_string "")
713
endif()
814

915
add_test_pl_tests(
10-
"$<TARGET_FILE:cbmc> --validate-goto-model --validate-ssa-equation" -X smt-backend ${gcc_only}
16+
"$<TARGET_FILE:cbmc> --validate-goto-model --validate-ssa-equation" -X smt-backend ${gcc_only} ${exclude_win_broken_tests}
1117
)
1218

1319
add_test_pl_profile(
1420
"cbmc-paths-lifo"
1521
"$<TARGET_FILE:cbmc> --paths lifo"
16-
"-C;-X;thorough-paths;-X;smt-backend;-X;paths-lifo-expected-failure;${gcc_only_string}-s;paths-lifo"
22+
"-C;-X;thorough-paths;-X;smt-backend;-X;paths-lifo-expected-failure;${gcc_only_string}-s;paths-lifo;${exclude_win_broken_tests_string}"
1723
"CORE"
1824
)
1925

2026
add_test_pl_profile(
2127
"cbmc-cprover-smt2"
2228
"$<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"
29+
"-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}"
2430
"CORE"
2531
)
2632

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)