Skip to content

Commit fd3f5a8

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 b8678a4 commit fd3f5a8

File tree

30 files changed

+60
-33
lines changed

30 files changed

+60
-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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
default: tests.log
22

3+
include ../../src/config.inc
4+
include ../../src/common
5+
6+
ifeq ($(BUILD_ENV_),MSVC)
7+
no_pthread = -X pthread
8+
endif
9+
310
test:
4-
@../test.pl -c ../../../src/cbmc/cbmc
11+
@../test.pl -e -p -c ../../../src/cbmc/cbmc $(no_pthread)
512

613
tests.log: ../test.pl
7-
@../test.pl -c ../../../src/cbmc/cbmc
14+
@../test.pl -e -p -c ../../../src/cbmc/cbmc $(no_pthread)
815

916
show:
1017
@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;

0 commit comments

Comments
 (0)