Skip to content

Commit 26cfdd8

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 26cfdd8

File tree

17 files changed

+93
-26
lines changed

17 files changed

+93
-26
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: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,30 @@
22

33
cleanup()
44
{
5-
rm -f $ofile $accfile $instrfile
5+
rm -rf "$target_dir"
66
}
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=""
16-
ofile=`mktemp`
17-
instrfile=`mktemp`
18-
accfile=`mktemp`
20+
21+
# create the temporary directory relative to the current directory, thus
22+
# avoiding file names that start with a "/", which confuses goto-cl (Windows)
23+
# when running in git-bash.
24+
target_dir="$(TMPDIR=. mktemp -d)"
25+
26+
ofile="$target_dir/compiled.gb"
27+
instrfile="$target_dir/instrumented.gb"
28+
accfile="$target_dir/accelerated.gb"
1929

2030
for a in "$@"
2131
do
@@ -29,7 +39,12 @@ case $a in
2939
esac
3040
done
3141

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
42+
if [[ "${is_windows}" == "true" ]]; then
43+
$goto_cc "$cfile" "/Fe$ofile"
44+
else
45+
$goto_cc -o "$ofile" "$cfile"
46+
fi
47+
48+
"$goto_instrument" --inline --remove-pointers "$ofile" "$instrfile"
49+
"$goto_instrument" --accelerate "$instrfile" "$accfile"
50+
"$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)