Skip to content

Commit de9b6e2

Browse files
committed
Enable goto-analyzer-simplify regression tests
Updated scripts and test specifications to work in current environments.
1 parent ac11ec8 commit de9b6e2

File tree

13 files changed

+56
-47
lines changed

13 files changed

+56
-47
lines changed

regression/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ add_subdirectory(goto-cc-cbmc)
4949
add_subdirectory(goto-cc-cbmc-shared-options)
5050
add_subdirectory(cbmc-cpp)
5151
add_subdirectory(goto-cc-goto-analyzer)
52+
add_subdirectory(goto-analyzer-simplify)
5253
add_subdirectory(statement-list)
5354
add_subdirectory(systemc)
5455
add_subdirectory(contracts)

regression/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ DIRS = cbmc \
2424
goto-cc-cbmc-shared-options \
2525
cbmc-cpp \
2626
goto-cc-goto-analyzer \
27+
goto-analyzer-simplify \
2728
statement-list \
2829
systemc \
2930
contracts \
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_test_pl_tests(
2+
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-analyzer>"
3+
)

regression/goto-analyzer-simplify/Makefile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
21
default: tests.log
32

43
test:
5-
@if ! ../test.pl -c ../chain.sh ; then \
6-
../failed-tests-printer.pl ; \
7-
exit 1; \
8-
fi
4+
@../test.pl -e -p -c "../chain.sh ../../../src/goto-analyzer/goto-analyzer"
95

10-
tests.log:
11-
@if ! ../test.pl -c ../chain.sh ; then \
12-
../failed-tests-printer.pl ; \
13-
exit 1; \
14-
fi
6+
tests.log: ../test.pl
7+
@../test.pl -e -p -c "../chain.sh ../../../src/goto-analyzer/goto-analyzer"
158

169
show:
1710
@for dir in *; do \
1811
if [ -d "$$dir" ]; then \
19-
vim -o "$$dir/*.c" "$$dir/*.out"; \
12+
vim -o "$$dir/*.java" "$$dir/*.out"; \
2013
fi; \
2114
done;
2215

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/bin/bash
22

3-
src_dir=../../../src
3+
set -e
44

5-
goto_analyzer=$src_dir/goto-analyzer/goto-analyzer
5+
goto_analyzer=$1
66

7-
options=$1
8-
file_name=${2%.c}
7+
options=${*:2:$#-2}
8+
name=${*:$#}
9+
name=${name%.c}
910

10-
echo options: $options
11-
echo file name : $file_name
12-
13-
$goto_analyzer $file_name.c $options --simplify $file_name_simp.out
14-
$goto_analyzer $file_name_simp.out --show-goto-functions
11+
"${goto_analyzer}" "${name}.c" ${options} --simplify "${name}.gb"
12+
"${goto_analyzer}" "${name}.gb" --show-goto-functions
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
CORE
22
main.c
3-
"--variable-sensitivity --vsd-arrays"
4-
5-
arr\[0l\]
3+
--vsd --vsd-arrays every-element
4+
arr\[0l?l?\]
5+
^SIGNAL=0$
6+
^EXIT=0$
7+
--

regression/goto-analyzer-simplify/simplify-complex-expression/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
CORE
22
main.c
3-
--variable-sensitivity
3+
--vsd
44
r == 2
55
^SIGNAL=0$
6-
^EXIT=6$
6+
^EXIT=0$
77
--
88
--
99

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
CORE
22
main.c
3-
"--variable-sensitivity --vsd-arrays"
4-
5-
arr\[0l\] =
6-
arr\[1l\] =
7-
arr\[\(signed long int\)nondet\] =
3+
--vsd --vsd-arrays every-element
4+
arr\[0l?l?\] =
5+
arr\[1l?l?\] =
6+
arr\[\(signed (long (long )?)?int\)nondet\] =
7+
^SIGNAL=0$
8+
^EXIT=0$
9+
--
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
CORE
22
main.c
3-
"--variable-sensitivity --vsd-arrays --vsd-pointers"
4-
3+
--vsd --vsd-arrays every-element --vsd-pointers value-set
54
symbol_a = 1
65
symbol_b = 2
7-
\*arr\[2l\] = 3;
8-
\*arr\[\(signed long int\)nondet_index\] = 4;
6+
\*arr\[2l?l?\] = 3;
7+
\*arr\[\(signed (long (long )?)?int\)nondet_index\] = 4;
8+
^SIGNAL=0$
9+
^EXIT=0$
10+
--
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
CORE
22
main.c
3-
"--variable-sensitivity --vsd-pointers"
4-
3+
--vsd --vsd-pointers value-set
54
symbol = 5
65
\*pointer = 6
6+
^SIGNAL=0$
7+
^EXIT=0$
8+
--
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
CORE
22
main.c
3-
"--variable-sensitivity --vsd-arrays --vsd-pointers --vsd-structs"
4-
3+
--vsd --vsd-arrays every-element --vsd-pointers value-set --vsd-structs every-field
54
symbol = 5
65
\*value\.pointer_component = 6
7-
value\.array\[1l\] = 2
8-
value\.array\[\(signed long int\)nondet\] = 3
6+
value\.array\[1l?l?\] = 2
7+
value\.array\[\(signed (long (long )?)?int\)nondet\] = 3
8+
^SIGNAL=0$
9+
^EXIT=0$
10+
--
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
CORE
22
main.c
3-
"--variable-sensitivity --vsd-arrays --vsd-pointers"
4-
array\[0l\] = 5
5-
array\[\(signed long int\)nondet\] = 6
6-
new_array\[1l\] = 7
3+
--vsd --vsd-arrays every-element --vsd-pointers value-set
4+
array\[0l?l?\] = 5
5+
array\[\(signed (long (long )?)?int\)nondet\] = 6
6+
new_array\[1l?l?\] = 7
7+
^SIGNAL=0$
8+
^EXIT=0$
9+
--
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
CORE
22
main.c
3-
"--variable-sensitivity"
3+
--vsd
44
^SIGNAL=0$
5-
^EXIT=6$
5+
^EXIT=0$
66
main#return_value = 0;
77
--
88
--
99
Tests that a multiplication
1010
of variable*variable can be simplified
11-
if one of the variables can be evaluated to 0.
11+
if one of the variables can be evaluated to 0.

0 commit comments

Comments
 (0)