Skip to content

Commit fd96acc

Browse files
authored
Merge pull request #705 from peterschrammel/pull-from-master
Update test-gen-support
2 parents c3cc872 + 58d6843 commit fd96acc

File tree

59 files changed

+364
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+364
-169
lines changed

CHANGELOG

+93
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,96 @@
1+
5.7
2+
===
3+
4+
* General: All tools now support the same set of --*-check options.
5+
* General: Added --conversion-check to catch type casts that cause loss of
6+
information. Previously --(un)signed-overflow-check would report these.
7+
* CBMC: New option --symex-coverage-report to produce a Cobertura-compatible
8+
statement- and branch coverage report.
9+
* CBMC/Java: New options --java-max-vla-length, --java-unwind-enum-static,
10+
--java-cp-include-files, --lazy-methods.
11+
* GOTO-INSTRUMENT: Static loop unwinding via --unwind or via new options
12+
--unwindset, --unwindset-file, --unwinding-assertions, --partial-loops,
13+
--continue-as-loops, --log
14+
* GOTO-INSTRUMENT: New option --slice-global-inits
15+
* GOTO-INSTRUMENT: Inlining via --inline, --partial-inline, --function-inline,
16+
--no-caching
17+
* GOTO-INSTRUMENT: New options --remove-function-pointers, --model-argc-argv,
18+
--show-threaded
19+
* GOTO-CC: Additional drop-in replacement support for bcc, as, as86
20+
* GOTO-CC: GCC-style error/warning messages
21+
* GOTO-CC: New options --native-compiler and --native-linker to select the
22+
compiler/linker to be used when building combined native/goto object files.
23+
24+
25+
5.6
26+
===
27+
28+
Bugfixes in the C, C++, Java front-ends.
29+
30+
31+
5.5
32+
===
33+
34+
This is a major release, with significant changes. The option
35+
--all-properties is now the default; to restore the previous behaviour,
36+
use --stop-on-fail. The primary area of attention was again the Java
37+
front-end. We have furthermore added test-suite generation for branch
38+
coverage, location coverage, condition coverage, decision coverage and
39+
MC/DC.
40+
41+
42+
5.4
43+
===
44+
45+
This is a minor release, focused primarily on maintenance. The primary
46+
area of attention was again the Java front-end. We have also updated to
47+
Minisat 2.2.1.
48+
49+
50+
5.3
51+
===
52+
53+
This is a minor release, focused primarily on maintenance. The primary
54+
area of attention is the Java front-end.
55+
56+
57+
5.2
58+
===
59+
60+
This is a minor release, focused primarily on maintenance. The primary
61+
areas of attention are the full slicer, the Java frontend, test suite
62+
generation and support for the Glucose solver.
63+
64+
65+
5.1
66+
===
67+
68+
This is a minor release, focused primarily on maintenance. Support for solving
69+
floating-point problems using for SMT-LIB2 solvers without support for the
70+
floating-point theory has been added.
71+
72+
73+
5.0
74+
===
75+
76+
This is a major release, focused primarily on performance improvements.
77+
Furthermore, the support for the floating-point theory for SMT-LIB2 has been
78+
improved substantially. This release breaks compatibility with the goto-binary
79+
format used by earlier releases; i.e., you will need to rebuild your
80+
goto-binaries.
81+
82+
83+
4.9
84+
===
85+
86+
This release is primarily for maintenance purposes and does not add any major
87+
new features. The support for SMT-LIB2 solvers has been improved substantially.
88+
89+
90+
4.8
91+
===
92+
93+
194
4.7
295
===
396

COMPILING

+9-2
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,25 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
3636

3737
On Red Hat/Fedora or derivates, do
3838

39-
yum install gcc gcc-c++ flex bison perl-libwww-perl patch
39+
yum install gcc gcc-c++ flex bison perl-libwww-perl patch devtoolset-6
4040

4141
Note that you need g++ version 5.2 or newer.
4242

4343
1) As a user, get the CBMC source via
4444

4545
git clone https://github.com/diffblue/cbmc cbmc-git
4646

47-
2) Do
47+
2) On Debian/Ubuntu, do
4848

4949
cd cbmc-git/src
5050
make minisat2-download
51+
make CXX=g++-6
52+
53+
On Redhat/Fedora etc., do
54+
55+
cd cbmc-git/src
56+
make minisat2-download
57+
scl enable devtoolset-6 bash
5158
make
5259

5360

Binary file not shown.

regression/cbmc-java/multinewarray/multinewarray.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public static void main(String[] args)
1212
assert some_a[0].length==3;
1313
assert some_a[0][0].length==2;
1414

15-
int x=10;
16-
int y=20;
15+
int x=3;
16+
int y=5;
1717
int[][] int_array = new int[x][y];
1818

1919
for(int i=0; i<x; ++i)

regression/cbmc-java/multinewarray/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
multinewarray.class
33

44
^EXIT=0$

regression/cbmc/Quantifiers-assertion/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ main.c
88
^\[main.assertion.4\] NotExists-Forall: failed: FAILURE$
99
^\[main.assertion.5\] NotForall-Forall: successful: SUCCESS$
1010
^\[main.assertion.6\] NotForall-NotForall: successful: SUCCESS$
11-
1211
^\*\* 2 of 6 failed \(2 iterations\)$
1312
^\VERIFICATION FAILED$

regression/cbmc/Quantifiers-assignment/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ main.c
66
^\[main.assertion.2\] assertion y: FAILURE$
77
^\[main.assertion.3\] assertion z1: SUCCESS$
88
^\[main.assertion.4\] assertion z2: SUCCESS$
9-
109
^\*\* 1 of 4 failed \(2 iterations\)$
1110
^\VERIFICATION FAILED$

regression/cbmc/Quantifiers-copy/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ main.c
77
^\[main.assertion.3\] assertion b\[.*\] == 2: SUCCESS$
88
^\[main.assertion.4\] assertion b\[.*\] == 3: SUCCESS$
99
^\[main.assertion.5\] assertion b\[.*\] == 4: SUCCESS$
10-
1110
^\*\* 0 of 5 failed \(1 iteration\)$
1211
^VERIFICATION SUCCESSFUL$

regression/cbmc/Quantifiers-if/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ main.c
77
^\[main.assertion.3\] success 1: SUCCESS$
88
^\[main.assertion.4\] failure 3: FAILURE$
99
^\[main.assertion.5\] success 2: SUCCESS$
10-
1110
^\*\* 3 of 5 failed \(2 iterations\)$
1211
^\VERIFICATION FAILED$

regression/cbmc/Quantifiers-initialisation/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ main.c
77
^\[main.assertion.3\] assertion a\[.*\] == 3: SUCCESS$
88
^\[main.assertion.4\] assertion a\[.*\] == 4: SUCCESS$
99
^\[main.assertion.5\] assertion a\[.*\] == 5: SUCCESS$
10-
1110
^\*\* 0 of 5 failed \(1 iteration\)$
1211
^VERIFICATION SUCCESSFUL$

regression/cbmc/Quantifiers-initialisation2/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ main.c
77
^\[main.assertion.3\] assertion a\[.*\] > a\[.*\]: FAILURE$
88
^\[main.assertion.4\] forall c\[\]: SUCCESS$
99
^\[main.assertion.5\] assertion c\[.*\] >= c\[.*\]: SUCCESS$
10-
1110
^\*\* 1 of 5 failed \(2 iterations\)$
1211
^VERIFICATION FAILED$

regression/cbmc/Quantifiers-invalid-var-range/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ CORE
22
main.c
33

44
^\*\* Results:$
5-
65
^\*\* 0 of 1 failed \(1 iteration\)$
76
^VERIFICATION SUCCESSFUL$

regression/cbmc/Quantifiers-not-exists/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ main.c
88
^\[main.assertion.4\] assertion tmp_if_expr\$9: SUCCESS$
99
^\[main.assertion.5\] assertion tmp_if_expr\$12: SUCCESS$
1010
^\[main.assertion.6\] assertion tmp_if_expr\$15: SUCCESS$
11-
1211
^\*\* 0 of 6 failed \(1 iteration\)$
1312
^\VERIFICATION SUCCESSFUL$

regression/cbmc/Quantifiers-not/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ main.c
77
^\[main.assertion.3\] failure 1: FAILURE$
88
^\[main.assertion.4\] success 3: SUCCESS$
99
^\[main.assertion.5\] failure 2: FAILURE$
10-
1110
^\*\* 2 of 5 failed \(2 iterations\)$
1211
^\VERIFICATION FAILED$

regression/cbmc/Quantifiers-two-dimension-array/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ main.c
77
^\[main.assertion.3\] assertion a\[.*\]\[.*\] == 1: SUCCESS$
88
^\[main.assertion.4\] assertion a\[.*\]\[.*\] == 2: SUCCESS$
99
^\[main.assertion.5\] assertion tmp_if_expr\$3: SUCCESS$
10-
1110
^\*\* 0 of 5 failed \(1 iteration\)$
1211
^VERIFICATION SUCCESSFUL$

regression/cbmc/Quantifiers-type/test.desc

-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ main.c
44
^\*\* Results:$
55
^\[main.assertion.1\] assertion tmp_if_expr\$1: FAILURE$
66
^\[main.assertion.2\] assertion tmp_if_expr\$2: SUCCESS$
7-
87
^\*\* 1 of 2 failed \(2 iterations\)$
98
^\VERIFICATION FAILED$

regression/goto-analyzer/Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
default: tests.log
22

33
test:
4-
@../test.pl -c ../../../src/goto-analyzer/goto-analyzer
4+
@if ! ../test.pl -c ../../../src/goto-analyzer/goto-analyzer ; then \
5+
../failed-tests-printer.pl ; \
6+
exit 1 ; \
7+
fi
58

69
tests.log: ../test.pl
7-
@../test.pl -c ../../../src/goto-analyzer/goto-analyzer
10+
@if ! ../test.pl -c ../../../src/goto-analyzer/goto-analyzer ; then \
11+
../failed-tests-printer.pl ; \
12+
exit 1 ; \
13+
fi
814

915
show:
1016
@for dir in *; do \
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <stdlib.h>
2+
#include <assert.h>
3+
4+
int main()
5+
{
6+
int *ptr=malloc(sizeof(int));
7+
*ptr=42;
8+
ptr=realloc(ptr, 20);
9+
assert(*ptr==42);
10+
11+
int *ptr2=malloc(2*sizeof(int));
12+
*ptr2=42;
13+
*(ptr2+1)=42;
14+
ptr2=realloc(ptr2, 20);
15+
assert(*ptr2==42);
16+
assert(*(ptr2+1)==42);
17+
18+
return 0;
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
main.c
3+
--full-slice --add-library
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <stdlib.h>
2+
#include <assert.h>
3+
4+
void foo(int argc)
5+
{
6+
void* x=0;
7+
8+
if(argc>3)
9+
x=malloc(4*sizeof(int));
10+
else
11+
x=malloc(3*sizeof(int));
12+
*(int*)x=42;
13+
14+
x=realloc(x, sizeof(int));
15+
16+
assert(*(int*)x==42);
17+
}
18+
19+
int main(int argc, char* argv[])
20+
{
21+
//__CPROVER_ASYNC_1:
22+
foo(argc);
23+
24+
return 0;
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
main.c
3+
--full-slice --add-library
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$

regression/test-script/excluded-line/program.c

-7
This file was deleted.

regression/test-script/excluded-line/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
program.c
2+
test.txt
33

44
^Hello$
55
--
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Hello
2+
World
3+

regression/test-script/failing-excluded-line/program.c

-7
This file was deleted.

regression/test-script/failing-excluded-line/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
KNOWNBUG
2-
program.c
2+
test.txt
33

44
^Hello$
55
--
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Hello
2+
World
3+

regression/test-script/failing-multi-line/program.c

-7
This file was deleted.

regression/test-script/failing-multi-line/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
KNOWNBUG
2-
program.c
2+
test.txt
33

44
activate-multi-line-match
55
Hello\nAnother\nWorld
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Hello
2+
World
3+

regression/test-script/failing-single-line/program.c

-7
This file was deleted.

regression/test-script/failing-single-line/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
KNOWNBUG
2-
program.c
2+
test.txt
33

44
^Goodbye$
55
--
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Hello
2+
World
3+

regression/test-script/multi-line/program.c

-7
This file was deleted.

regression/test-script/multi-line/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
2-
program.c
2+
test.txt
33

44
activate-multi-line-match
55
Hello\nWorld
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Hello
2+
World
3+

regression/test-script/program_runner.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22

33
set -e
44

5-
gcc $1 -o a.out
6-
./a.out
5+
cat $1

0 commit comments

Comments
 (0)