Skip to content

Commit 48b9427

Browse files
Merge pull request #762 from smowton/smowton/merge/master_2017_04_05
Merge current cbmc/master into test-gen-support
2 parents 372bafb + f2bfd67 commit 48b9427

File tree

599 files changed

+11760
-1228
lines changed

Some content is hidden

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

599 files changed

+11760
-1228
lines changed

.travis.yml

+91-14
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,44 @@ matrix:
77
- os: linux
88
sudo: required
99
compiler: gcc
10+
cache: ccache
1011
services:
1112
- docker
1213
before_install:
13-
- docker pull diffblue/cbmc-builder:alpine
14+
- docker pull diffblue/cbmc-builder:alpine-0.0.1
1415
env:
15-
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc diffblue/cbmc-builder:alpine"
16-
- COMPILER=g++
16+
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc -v ${HOME}/.ccache:/root/.ccache diffblue/cbmc-builder:alpine-0.0.1"
17+
- COMPILER="ccache g++"
1718

1819
# OS X using g++
1920
- os: osx
2021
sudo: false
2122
compiler: gcc
23+
cache: ccache
24+
before_install:
25+
#we create symlink to non-ccache gcc, to be used in tests
26+
- mkdir bin ; ln -s /usr/bin/gcc bin/gcc
27+
- brew install ccache
28+
- export PATH=/usr/local/opt/ccache/libexec:$PATH
2229
env: COMPILER=g++
2330

2431
# OS X using clang++
2532
- os: osx
2633
sudo: false
2734
compiler: clang
28-
env: COMPILER=clang++
35+
cache: ccache
36+
before_install:
37+
- brew install ccache
38+
- export PATH=/usr/local/opt/ccache/libexec:$PATH
39+
env:
40+
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
41+
- CCACHE_CPP2=yes
2942

3043
# Ubuntu Linux with glibc using g++-5
3144
- os: linux
3245
sudo: false
3346
compiler: gcc
47+
cache: ccache
3448
addons:
3549
apt:
3650
sources:
@@ -42,12 +56,34 @@ matrix:
4256
before_install:
4357
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
4458
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
45-
env: COMPILER=g++-5
59+
env: COMPILER="g++-5"
60+
61+
# Ubuntu Linux with glibc using g++-5, debug mode
62+
- os: linux
63+
sudo: false
64+
compiler: gcc
65+
cache: ccache
66+
addons:
67+
apt:
68+
sources:
69+
- ubuntu-toolchain-r-test
70+
packages:
71+
- libwww-perl
72+
- g++-5
73+
- libubsan0
74+
before_install:
75+
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
76+
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
77+
env:
78+
- COMPILER="g++-5"
79+
- EXTRA_CXXFLAGS="-DDEBUG"
80+
script: echo "Not running any tests for a debug build."
4681

4782
# Ubuntu Linux with glibc using clang++-3.7
4883
- os: linux
4984
sudo: false
5085
compiler: clang
86+
cache: ccache
5187
addons:
5288
apt:
5389
sources:
@@ -60,19 +96,60 @@ matrix:
6096
- libubsan0
6197
before_install:
6298
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
99+
- export CCACHE_CPP2=yes
63100
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
64-
env: COMPILER=clang++-3.7
101+
env:
102+
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
103+
- CCACHE_CPP2=yes
65104

105+
# Ubuntu Linux with glibc using clang++-3.7, debug mode
106+
- os: linux
107+
sudo: false
108+
compiler: clang
109+
cache: ccache
110+
addons:
111+
apt:
112+
sources:
113+
- ubuntu-toolchain-r-test
114+
- llvm-toolchain-precise-3.7
115+
packages:
116+
- libwww-perl
117+
- clang-3.7
118+
- libstdc++-5-dev
119+
- libubsan0
120+
before_install:
121+
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
122+
- export CCACHE_CPP2=yes
123+
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
124+
env:
125+
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
126+
- CCACHE_CPP2=yes
127+
- EXTRA_CXXFLAGS="-DDEBUG"
128+
script: echo "Not running any tests for a debug build."
129+
130+
- env: NAME="CPP-LINT"
131+
install:
132+
script: scripts/travis_lint.sh
133+
before_cache:
134+
135+
allow_failures:
66136
- env: NAME="CPP-LINT"
67-
script: scripts/travis_lint.sh || true
137+
install:
138+
script: scripts/travis_lint.sh
139+
before_cache:
140+
141+
install:
142+
- COMMAND="make -C src minisat2-download" &&
143+
eval ${PRE_COMMAND} ${COMMAND}
144+
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare $EXTRA_CXXFLAGS\" -j2" &&
145+
eval ${PRE_COMMAND} ${COMMAND}
146+
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"$FLAGS $EXTRA_CXXFLAGS\" -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
147+
eval ${PRE_COMMAND} ${COMMAND}
68148

69149
script:
70-
- if [ -L bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
71-
COMMAND="make -C src minisat2-download" &&
72-
eval ${PRE_COMMAND} ${COMMAND} &&
73-
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare\" -j2" &&
74-
eval ${PRE_COMMAND} ${COMMAND} &&
150+
- if [ -e bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
75151
COMMAND="env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test" &&
76-
eval ${PRE_COMMAND} ${COMMAND} &&
77-
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
78152
eval ${PRE_COMMAND} ${COMMAND}
153+
154+
before_cache:
155+
- ccache -s

CHANGELOG

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
5.8
2+
===
3+
4+
* GOTO-INSTRUMENT: --reachability-slice can be used with --property to slice
5+
down to a single property only.
6+
* GOTO-INSTRUMENT: New option --list-calls-args
7+
* GOTO-INSTRUMENT: New option --print-path-lenghts
8+
* GOTO-ANALYZER: New option --unreachable-functions, --reachable-functions
9+
* GOTO-INSTRUMENT: New option --undefined-function-is-assume-false
10+
11+
112
5.7
213
===
314

@@ -20,6 +31,9 @@
2031
* GOTO-CC: GCC-style error/warning messages
2132
* GOTO-CC: New options --native-compiler and --native-linker to select the
2233
compiler/linker to be used when building combined native/goto object files.
34+
* CBMC, SYMEX, GOTO-INSTRUMENT: New option --drop-unused-functions. Removed
35+
ambiguous --show-reachable-properties.
36+
* CBMC: New option --no-built-in-assertions
2337

2438

2539
5.6

COMPILING

+14-13
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
4444

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

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

4949
cd cbmc-git/src
5050
make minisat2-download
5151
make CXX=g++-6
5252

53+
On Ubuntu, or other distributions with recent g++, do
54+
55+
cd cbmc-git/src
56+
make minisat2-download
57+
make
58+
5359
On Redhat/Fedora etc., do
5460

5561
cd cbmc-git/src
@@ -64,7 +70,7 @@ COMPILATION ON SOLARIS 11
6470
1) As root, get the necessary development tools:
6571

6672
pkg install system/header developer/lexer/flex developer/parser/bison developer/versioning/git
67-
pkg install --accept developer/gcc-5
73+
pkg install --accept developer/gcc/gcc-c++-5
6874

6975
2) As a user, get the CBMC source via
7076

@@ -86,9 +92,6 @@ COMPILATION ON SOLARIS 11
8692

8793
export LD_LIBRARY_PATH=/usr/gcc/4.9/lib
8894

89-
Do not attempt to compile with gcc-45 that comes with Solaris 11.
90-
It will mis-optimize MiniSat2.
91-
9295

9396
COMPILATION ON FREEBSD 11
9497
-------------------------
@@ -163,23 +166,21 @@ Follow these instructions:
163166
The patch removes the dependency on zlib and prevents a problem
164167
with a header file that is often unavailable on Windows.
165168

166-
2) Adjust src/config.inc for the paths to item 1).
167-
168-
3A) To compile with Cygwin, install the mingw compilers, and adjust
169+
2A) To compile with Cygwin, install the mingw compilers, and adjust
169170
the second line of config.inc to say
170171

171172
BUILD_ENV = MinGW
172173

173-
3B) To compile with Visual Studio, make sure you have at least Visual
174+
2B) To compile with Visual Studio, make sure you have at least Visual
174175
Studio version 12 (2013), and adjust the second line of config.inc to say
175176

176177
BUILD_ENV = MSVC
177178

178-
Open the Visual Studio Command prompt, and then run the make.exe
179-
from Cygwin from in there.
179+
Open the Visual Studio Command prompt, and then bash.exe -login from
180+
Cygwin from in there.
181+
182+
3) Type cd src; make - that should do it.
180183

181-
4) Type cd src; make - that should do it.
182-
Note that "nmake" is not expected to work. Use "make".
183184

184185
(Optional) A Visual Studio project file can be generated with the script
185186
"generate_vcxproj" that is in the subdirectory "scripts". The project file

doc/html-manual/cover.shtml

+10-6
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ To demonstrate the automatic test suite generation in CBMC,
149149
we call the following command and we are going to explain the command line options one by one.
150150
</p>
151151

152-
<pre><code>cbmc pid.c --cover mcdc --unwind 6 --trace --xml-ui
152+
<pre><code>cbmc pid.c --cover mcdc --unwind 6 --xml-ui
153153
</code></pre>
154154

155155
<p class="justified">
@@ -173,18 +173,22 @@ pprz >= (float)0 && pprz <= (float)(16 * 600) id="climb_pid_run.coverage.3"
173173

174174
<p class="justified">
175175
The "id" of each coverage goal is automatically assigned by CBMC. For every
176-
coverage goal, a trace (if there exists) of the program execution that
177-
satisfies such a goal is printed out in XML format, as the parameters
178-
<code>--trace --xml-ui</code> are given. Multiple coverage goals can share a
179-
trace, when the corresponding execution of the program satisfies all these
180-
goals at the same time. Each trace corresponds to a test case.
176+
coverage goal, a test suite (if there exists) that <!-- the program execution that-->
177+
satisfies such a goal is printed out in XML format, as the parameter
178+
<code>--xml-ui</code> is given. Multiple coverage goals can share a
179+
test suite, when the corresponding execution of the program satisfies all these
180+
goals at the same time. <!--Each trace corresponds to a test case.-->
181181
</p>
182182

183183
<p class="justified">
184184
In the end, the following test suites are automatically generated for testing the PID controller.
185185
A test suite consists of a sequence of input parameters that are
186186
passed to the PID function <code>climb_pid_run</code> at each loop iteration.
187187
For example, Test 1 covers the MC/DC goal with id="climb_pid_run.coverage.1".
188+
The complete output from CBMC is in
189+
<a href="pid_test_suites.xml">pid_test_suites.xml</a>, where every test suite and the coverage goals it is for
190+
are clearly described.
191+
188192
<pre><code>Test suite:
189193
Test 1.
190194
(iteration 1) desired_climb=-1.000000f, estimator_z_dot=1.000000f

0 commit comments

Comments
 (0)