Skip to content

Commit 0f4916b

Browse files
committed
Enable cbmc-concurrency regression tests by default
For some reason we had not included these in our standard set of regression tests, and sure enough they got out of sync and one actual regression happened.
1 parent bbb1ce8 commit 0f4916b

File tree

29 files changed

+49
-33
lines changed

29 files changed

+49
-33
lines changed

regression/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ add_subdirectory(goto-analyzer)
2929
add_subdirectory(ansi-c)
3030
add_subdirectory(goto-instrument)
3131
add_subdirectory(cpp)
32+
add_subdirectory(cbmc-concurrency)
3233
add_subdirectory(cbmc-cover)
3334
add_subdirectory(goto-instrument-typedef)
3435
add_subdirectory(smt2_solver)

regression/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ DIRS = cbmc \
77
ansi-c \
88
goto-instrument \
99
cpp \
10+
cbmc-concurrency \
1011
cbmc-cover \
1112
goto-instrument-typedef \
1213
smt2_solver \
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if(NOT WIN32)
2+
add_test_pl_tests(
3+
"$<TARGET_FILE:cbmc>"
4+
)
5+
else()
6+
add_test_pl_tests(
7+
"$<TARGET_FILE:cbmc>"
8+
"cbmc-concurrency"
9+
"$<TARGET_FILE:cbmc>"
10+
"-C;-X;pthread"
11+
"CORE"
12+
)
13+
endif()

regression/cbmc-concurrency/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
default: tests.log
22

3+
ifeq ($(BUILD_ENV_),MSVC)
4+
no_pthread = -X pthread
5+
endif
6+
37
test:
4-
@../test.pl -c ../../../src/cbmc/cbmc
8+
@../test.pl -e -p -c ../../../src/cbmc/cbmc $(no_pthread)
59

610
tests.log: ../test.pl
7-
@../test.pl -c ../../../src/cbmc/cbmc
11+
@../test.pl -e -p -c ../../../src/cbmc/cbmc $(no_pthread)
812

913
show:
1014
@for dir in *; do \
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
main.c
33

4-
^EXIT=10$
4+
^EXIT=6$
55
^SIGNAL=0$
6-
^file main.c line 12 function spawn: start_thread in atomic section detected$
6+
^spawning threads out of atomic sections is not allowed
77
--
88
^warning: ignoring

regression/cbmc-concurrency/conditional_spawn1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33

44
^EXIT=10$

regression/cbmc-concurrency/deadlock1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33

44
^EXIT=0$

regression/cbmc-concurrency/deadlock2/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33

44
^EXIT=10$

regression/cbmc-concurrency/malloc1/main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <stdlib.h>
2-
#include <pthread.h>
32

43
#define BUG
54

@@ -13,12 +12,9 @@ void* set_x(void* arg) {
1312
}
1413

1514
int main() {
16-
pthread_t thread;
1715
x = malloc(sizeof(int));
1816
#ifdef BUG
1917
__CPROVER_ASYNC_1: set_x(NULL);
20-
//pthread_create(&thread,NULL,set_x,NULL);
21-
//pthread_join(thread,NULL);
2218
__CPROVER_assume(set_done);
2319
#else
2420
set_x(NULL);

regression/cbmc-concurrency/malloc2/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <stdlib.h>
2-
#include <pthread.h>
32

43
_Bool set_done;
54
int *ptr;

regression/cbmc-concurrency/memory_barrier1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33
--unwind 1 --no-unwinding-assertions
44
^EXIT=0$
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--mm tso
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
77
--
88
^warning: ignoring
9+
--
10+
Some past change broke this test such that we now report verification failures.

regression/cbmc-concurrency/mutex2/test.desc

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

regression/cbmc-concurrency/norace_array1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
KNOWNBUG pthread
22
main.c
33

44
^EXIT=0$

regression/cbmc-concurrency/norace_array2/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
KNOWNBUG pthread
22
main.c
33

44
^EXIT=0$

regression/cbmc-concurrency/norace_scalar1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33

44
^EXIT=0$

regression/cbmc-concurrency/norace_struct1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
KNOWNBUG pthread
22
main.c
33

44
^EXIT=0$

regression/cbmc-concurrency/pthread_create_tso1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33
--mm tso
44
^EXIT=0$
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
CORE
1+
CORE pthread
22
main.c
33
--all-properties
44
^EXIT=10$
55
^SIGNAL=0$
6-
^\[main\.assertion\.1\] assertion i==1: FAILURE$
7-
^\[main\.assertion\.2\] assertion i==2: SUCCESS$
6+
^\[main\.assertion\.1\] line 21 assertion i==1: FAILURE$
7+
^\[main\.assertion\.2\] line 22 assertion i==2: SUCCESS$
88
^\*\* 1 of 2 failed
99
--
1010
^warning: ignoring

regression/cbmc-concurrency/pthread_join2/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33
--unwind 2
44
^EXIT=10$

regression/cbmc-concurrency/sc6/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33

44
^EXIT=0$

regression/cbmc-concurrency/svcomp13_fib_bench_longer_safe/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33
--error-label ERROR
44
^EXIT=0$

regression/cbmc-concurrency/svcomp13_fib_bench_longer_unsafe/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33
--error-label ERROR
44
^EXIT=10$

regression/cbmc-concurrency/thread_chain_posix1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33

44
^EXIT=10$

regression/cbmc-concurrency/thread_chain_posix2/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
KNOWNBUG pthread
22
main.c
33
-D_ENABLE_CHAIN_ --unwind 2
44
^EXIT=0$

regression/cbmc-concurrency/thread_chain_posix3/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
KNOWNBUG pthread
22
main.c
33
-D_ENABLE_CHAIN_ -D_SANITY_CHECK_ --unwind 2
44
^EXIT=10$

regression/cbmc-concurrency/thread_local1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33

44
^EXIT=0$

regression/cbmc-concurrency/trace1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ main.c
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7-
^[[:space:]]*r2=1u \(.*\)$
7+
^[[:space:]]*r2=1u(l)? \(.*\)$
88
--
99
^warning: ignoring

regression/cbmc-concurrency/uf_with_threads1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE pthread
22
main.c
33

44
^EXIT=0$

0 commit comments

Comments
 (0)