Skip to content

Commit ad136ed

Browse files
committed
Enable regression tests of loop acceleration
With the bugs fixed in the preceding commit, tests run without crashing. For some of them, however, the reported results are incorrect. These are now marked as KNOWNBUG and need debugging at a later time.
1 parent 7f2b979 commit ad136ed

File tree

17 files changed

+83
-22
lines changed

17 files changed

+83
-22
lines changed

regression/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ add_subdirectory(goto-cc-goto-analyzer)
5252
add_subdirectory(statement-list)
5353
add_subdirectory(systemc)
5454
add_subdirectory(contracts)
55+
add_subdirectory(acceleration)
5556
add_subdirectory(goto-harness)
5657
add_subdirectory(goto-harness-multi-file-project)
5758
add_subdirectory(goto-cc-file-local)

regression/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ DIRS = cbmc \
2727
statement-list \
2828
systemc \
2929
contracts \
30+
acceleration \
3031
goto-harness \
3132
goto-harness-multi-file-project \
3233
goto-cc-file-local \
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
if(WIN32)
2+
set(is_windows true)
3+
else()
4+
set(is_windows false)
5+
endif()
6+
7+
add_test_pl_tests(
8+
"../accelerate.sh \
9+
$<TARGET_FILE:goto-cc> \
10+
$<TARGET_FILE:goto-instrument> \
11+
$<TARGET_FILE:cbmc> \
12+
${is_windows}")

regression/acceleration/Makefile

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

3+
include ../../src/config.inc
4+
include ../../src/common
5+
6+
GOTO_INSTRUMENT_EXE=../../../src/goto-instrument/goto-instrument
7+
CBMC_EXE=../../../src/cbmc/cbmc
8+
9+
ifeq ($(BUILD_ENV_),MSVC)
10+
GOTO_CC_EXE=../../../src/goto-cc/goto-cl
11+
is_windows=true
12+
else
13+
GOTO_CC_EXE=../../../src/goto-cc/goto-cc
14+
is_windows=false
15+
endif
16+
317
test:
4-
@../test.pl -c ../../../src/goto-instrument/accelerate/accelerate.sh
18+
@../test.pl -e -p -c "../accelerate.sh $(GOTO_CC_EXE) $(GOTO_INSTRUMENT_EXE) $(CBMC_EXE) $(is_windows)"
519

620
tests.log: ../test.pl
7-
@../test.pl -c ../../../src/goto-instrument/accelerate/accelerate.sh
21+
@../test.pl -e -p -c "../accelerate.sh $(GOTO_CC_EXE) $(GOTO_INSTRUMENT_EXE) $(CBMC_EXE) $(is_windows)"
822

923
show:
1024
@for dir in *; do \

regression/acceleration/accelerate.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ cleanup()
77

88
trap cleanup EXIT
99

10-
bindir=`dirname $0`
11-
goto_cc="$bindir/../../goto-cc/goto-cc"
12-
goto_instrument="$bindir/../goto-instrument"
13-
cbmc="$bindir/../../cbmc/cbmc"
10+
set -e
11+
12+
goto_cc=$1
13+
goto_instrument=$2
14+
cbmc=$3
15+
is_windows=$4
16+
shift 4
17+
1418
cfile=""
1519
cbmcargs=""
1620
ofile=`mktemp`
@@ -29,7 +33,12 @@ case $a in
2933
esac
3034
done
3135

32-
$goto_cc $cfile -o $ofile || exit 1
33-
$goto_instrument --inline --remove-pointers $ofile $instrfile || exit 1
34-
timeout 5 $goto_instrument --accelerate $instrfile $accfile
35-
timeout 5 $cbmc --unwind 5 --z3 $cbmcargs $accfile
36+
if [[ "${is_windows}" == "true" ]]; then
37+
$goto_cc "$cfile" /Fe"$ofile"
38+
else
39+
$goto_cc -o "$ofile" "$cfile"
40+
fi
41+
42+
$goto_instrument --inline --remove-pointers $ofile $instrfile
43+
$goto_instrument --accelerate $instrfile $accfile
44+
$cbmc --unwind 5 $cbmcargs $accfile
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--no-unwinding-assertions
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
7+
--
8+
The result spuriously is VERIFICATION SUCCESSFUL.

0 commit comments

Comments
 (0)