Skip to content

Commit 54ca23e

Browse files
Merge branch 'develop' into develop-feature_generate_function_bodies
2 parents 1c9b407 + 1e7f2bc commit 54ca23e

File tree

512 files changed

+9834
-5110
lines changed

Some content is hidden

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

512 files changed

+9834
-5110
lines changed

.travis.yml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ jobs:
6262
- libwww-perl
6363
- g++-5
6464
- libubsan0
65+
- parallel
6566
before_install:
6667
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
6768
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
6869
env:
69-
- COMPILER="ccache g++-5"
70+
- COMPILER="ccache /usr/bin/g++-5"
7071
- EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG"
7172

7273
# OS X using g++
@@ -76,10 +77,8 @@ jobs:
7677
compiler: gcc
7778
cache: ccache
7879
before_install:
79-
#we create symlink to non-ccache gcc, to be used in tests
80-
- mkdir bin ; ln -s /usr/bin/gcc bin/gcc
81-
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
82-
- export PATH=/usr/local/opt/ccache/libexec:$PATH
80+
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache parallel
81+
- export PATH=$PATH:/usr/local/opt/ccache/libexec
8382
env: COMPILER="ccache g++"
8483

8584
# OS X using clang++
@@ -89,10 +88,11 @@ jobs:
8988
compiler: clang
9089
cache: ccache
9190
before_install:
92-
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
93-
- export PATH=/usr/local/opt/ccache/libexec:$PATH
91+
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache parallel
92+
- export PATH=$PATH:/usr/local/opt/ccache/libexec
9493
env:
95-
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
94+
- COMPILER="ccache clang++"
95+
- EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics"
9696
- CCACHE_CPP2=yes
9797

9898
# Ubuntu Linux with glibc using g++-5, debug mode
@@ -113,7 +113,7 @@ jobs:
113113
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
114114
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
115115
env:
116-
- COMPILER="ccache g++-5"
116+
- COMPILER="ccache /usr/bin/g++-5"
117117
- EXTRA_CXXFLAGS="-DDEBUG"
118118
script: echo "Not running any tests for a debug build."
119119

@@ -133,16 +133,17 @@ jobs:
133133
- clang-3.7
134134
- libstdc++-5-dev
135135
- libubsan0
136+
- parallel
136137
before_install:
137138
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
138139
- export CCACHE_CPP2=yes
139140
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
140141
env:
141-
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
142+
- COMPILER="ccache /usr/bin/clang++-3.7"
143+
- EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -DNDEBUG"
142144
- CCACHE_CPP2=yes
143-
- EXTRA_CXXFLAGS="-DNDEBUG"
144145

145-
# Ubuntu Linux with glibc using clang++-3.7, debug mode
146+
# Ubuntu Linux with glibc using clang++-3.7, debug mode, disable USE_DSTRING
146147
- stage: Test different OS/CXX/Flags
147148
os: linux
148149
sudo: false
@@ -163,14 +164,15 @@ jobs:
163164
- export CCACHE_CPP2=yes
164165
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
165166
env:
166-
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
167+
- COMPILER="ccache /usr/bin/clang++-3.7"
168+
- EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -DDEBUG -DUSE_STD_STRING"
167169
- CCACHE_CPP2=yes
168-
- EXTRA_CXXFLAGS="-DDEBUG"
169170
script: echo "Not running any tests for a debug build."
170171

171172
# cmake build using g++-5
172173
- stage: Test different OS/CXX/Flags
173174
os: linux
175+
compiler: gcc
174176
cache: ccache
175177
env:
176178
- BUILD_SYSTEM=cmake
@@ -180,19 +182,22 @@ jobs:
180182
- ubuntu-toolchain-r-test
181183
packages:
182184
- g++-5
185+
before_install:
186+
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
183187
install:
184188
- ccache -z
185189
- ccache --max-size=1G
186-
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=g++-5'
190+
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-5'
187191
- cmake --build build -- -j4
188192
script: (cd build; ctest -V -L CORE -j2)
189193

190194
- stage: Test different OS/CXX/Flags
191195
os: osx
196+
compiler: clang
192197
cache: ccache
193198
before_install:
194199
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
195-
- export PATH=/usr/local/opt/ccache/libexec:$PATH
200+
- export PATH=$PATH:/usr/local/opt/ccache/libexec
196201
env:
197202
- BUILD_SYSTEM=cmake
198203
- CCACHE_CPP2=yes
@@ -250,13 +255,13 @@ install:
250255
- ccache --max-size=1G
251256
- make -C src minisat2-download
252257
- make -C src/ansi-c library_check
253-
- make -C src "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
254-
- make -C src "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2 clobber.dir memory-models.dir
258+
- make -C src "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j3
259+
- make -C src "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j3 clobber.dir memory-models.dir
255260

256261
script:
257262
- if [ -e bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
258-
- env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
259-
- make -C unit "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
263+
- env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test-parallel "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j2 JOBS=2
264+
- make -C unit "CXX=${COMPILER} ${EXTRA_CXXFLAGS}" -j2
260265
- make -C unit test
261266

262267
before_cache:

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ src/cpp/ @kroening @tautschnig @peterschrammel
4646

4747
# These files change frequently and changes are low-risk
4848

49+
src/util/irep_ids.def @diffblue/cbmc-developers
50+
4951
unit/ @diffblue/cbmc-developers
5052
regression/ @diffblue/cbmc-developers
5153

buildspec.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
commands:
6+
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/toolchain.list
7+
- apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA9EF27F
8+
- apt-get update -y
9+
- apt-get install -y g++-5 flex bison make git libwww-perl patch ccache
10+
- apt-get install -y openjdk-7-jdk
11+
- update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1
12+
- update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 1
13+
build:
14+
commands:
15+
- echo Build started on `date`
16+
- (cd src ; make minisat2-download)
17+
- (cd src ; make CXX="ccache g++" -j2)
18+
- (cd regression ; make test)
19+
post_build:
20+
commands:
21+
- echo Build completed on `date`
22+
artifacts:
23+
files:
24+
cache:
25+
paths:
26+
- '/root/.ccache/**/*'

doc/architectural/cbmc-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,5 +597,5 @@ they are in the code.
597597
[^2]: Or references, if reference counted data sharing is enabled. It is
598598
enabled by default; see the `SHARING` macro.
599599

600-
[^3]: When `USE_DSTRING` is enabled (it is by default), this is actually
600+
[^3]: Unless `USE_STD_STRING` is set, this is actually
601601
a `dstring` and thus an integer which is a reference into a string table

regression/CMakeLists.txt

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,29 @@ macro(add_test_pl_tests cmdline)
2020
add_test_pl_profile("${TEST_DIR_NAME}" "${cmdline}" -K KNOWNBUG ${ARGN})
2121
endmacro(add_test_pl_tests)
2222

23-
add_subdirectory(ansi-c)
23+
# For the best possible utilisation of multiple cores when
24+
# running tests in parallel, it is important that these directories are
25+
# listed with decreasing runtimes (i.e. longest running at the top)
2426
add_subdirectory(cbmc)
25-
add_subdirectory(cbmc-cover)
26-
add_subdirectory(cbmc-cpp)
2727
add_subdirectory(cbmc-java)
28-
add_subdirectory(cbmc-java-inheritance)
29-
add_subdirectory(cpp)
3028
add_subdirectory(goto-analyzer)
31-
add_subdirectory(goto-analyzer-taint)
32-
add_subdirectory(goto-cc-cbmc)
33-
add_subdirectory(goto-cc-goto-analyzer)
34-
add_subdirectory(goto-diff)
29+
add_subdirectory(ansi-c)
30+
add_subdirectory(jbmc-strings)
3531
add_subdirectory(goto-instrument)
32+
add_subdirectory(cpp)
33+
add_subdirectory(strings-smoke-tests)
34+
add_subdirectory(cbmc-cover)
3635
add_subdirectory(goto-instrument-typedef)
36+
add_subdirectory(strings)
37+
add_subdirectory(invariants)
38+
add_subdirectory(goto-diff)
39+
add_subdirectory(test-script)
40+
add_subdirectory(goto-analyzer-taint)
41+
add_subdirectory(cbmc-java-inheritance)
3742
if(NOT WIN32)
3843
add_subdirectory(goto-gcc)
3944
endif()
40-
add_subdirectory(invariants)
41-
add_subdirectory(jbmc-strings)
42-
add_subdirectory(strings)
43-
add_subdirectory(strings-smoke-tests)
44-
add_subdirectory(test-script)
45+
add_subdirectory(goto-cc-cbmc)
46+
add_subdirectory(cbmc-cpp)
47+
add_subdirectory(goto-cc-goto-analyzer)
48+

regression/Makefile

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,62 @@
1-
DIRS = ansi-c \
2-
cbmc \
3-
cbmc-cover \
4-
cbmc-cpp \
1+
# For the best possible utilisation of multiple cores when
2+
# running tests in parallel, it is important that these directories are
3+
# listed with decreasing runtimes (i.e. longest running at the top)
4+
DIRS = cbmc \
55
cbmc-java \
6-
cbmc-java-inheritance \
7-
cpp \
86
goto-analyzer \
9-
goto-analyzer-taint \
10-
goto-cc-cbmc \
11-
goto-cc-goto-analyzer \
12-
goto-diff \
13-
goto-gcc \
7+
ansi-c \
8+
jbmc-strings \
149
goto-instrument \
10+
cpp \
11+
strings-smoke-tests \
12+
cbmc-cover \
1513
goto-instrument-typedef \
16-
invariants \
1714
strings \
18-
jbmc-strings \
19-
strings-smoke-tests \
15+
invariants \
16+
goto-diff \
2017
test-script \
18+
goto-analyzer-taint \
19+
cbmc-java-inheritance \
20+
goto-gcc \
21+
goto-cc-cbmc \
22+
cbmc-cpp \
23+
goto-cc-goto-analyzer \
2124
# Empty last line
2225

23-
# Check for the existence of $dir. Tests under goto-gcc cannot be run on
24-
# Windows, so appveyor.yml unlinks the entire directory under Windows.
26+
# Tests under goto-gcc cannot be run on Windows, so appveyor.yml unlinks
27+
# the entire directory under Windows. This variable will contain the list
28+
# of directories that actually exist on the current platform.
29+
PLATFORM_DIRS = $(wildcard $(DIRS))
30+
31+
# Run all test directories in sequence
32+
.PHONY: test
2533
test:
26-
@for dir in $(DIRS); do \
27-
if [ -d "$$dir" ]; then \
28-
$(MAKE) -C "$$dir" test || exit 1; \
29-
fi; \
34+
@for dir in $(PLATFORM_DIRS); do \
35+
$(MAKE) "$$dir" || exit 1; \
3036
done;
3137

38+
# Pattern to execute a single test suite directory
39+
.PHONY: $(PLATFORM_DIRS)
40+
$(PLATFORM_DIRS):
41+
@echo "Running $@..." ;
42+
$(MAKE) -C "$@" test || exit 1;
43+
44+
# Run all test directories using GNU Parallel
45+
.PHONY: test-parallel
46+
.NOTPARALLEL: test-parallel
47+
test-parallel:
48+
@echo "Building with $(JOBS) jobs"
49+
parallel \
50+
--halt soon,fail=1 \
51+
--tag \
52+
--tagstring '{#}:' \
53+
--linebuffer \
54+
--jobs $(JOBS) \
55+
$(MAKE) "{}" \
56+
::: $(PLATFORM_DIRS)
57+
58+
59+
.PHONY: clean
3260
clean:
3361
@for dir in *; do \
3462
if [ -d "$$dir" ]; then \

regression/cbmc-from-CVS/Array_operations1/main.c

Lines changed: 0 additions & 37 deletions
This file was deleted.

regression/cbmc-java/instanceof1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
instanceof1.class
33

44
^EXIT=0$

regression/cbmc-java/instanceof3/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
instanceof3.class
33

44
^EXIT=0$

regression/cbmc-java/lambda1/B.class

1.32 KB
Binary file not shown.

regression/cbmc-java/lambda1/B.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
public class B {
2+
public int y;
3+
4+
public static java.util.function.Function<Double, Double> dmul = x -> x * 3.1415;
5+
6+
public void set(int x) {
7+
y = x;
8+
}
9+
}

regression/cbmc-java/lambda1/C.class

582 Bytes
Binary file not shown.
299 Bytes
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@FunctionalInterface
2+
interface CustomLambda<T> {
3+
boolean is_ok(T t);
4+
}
401 Bytes
Binary file not shown.
4.84 KB
Binary file not shown.

0 commit comments

Comments
 (0)