Skip to content

Commit 3089cab

Browse files
authored
Merge pull request diffblue#292 from diffblue/pull-support-20171212
Merge latest cbmc/develop into cbmc subtree
2 parents fe578c6 + 0d4dd99 commit 3089cab

File tree

392 files changed

+7143
-2383
lines changed

Some content is hidden

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

392 files changed

+7143
-2383
lines changed

cbmc/.travis.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ jobs:
6565
before_install:
6666
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
6767
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
68-
env: COMPILER="ccache g++-5"
68+
env:
69+
- COMPILER="ccache g++-5"
70+
- EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG"
6971

7072
# OS X using g++
7173
- stage: Test different OS/CXX/Flags
@@ -115,7 +117,7 @@ jobs:
115117
- EXTRA_CXXFLAGS="-DDEBUG"
116118
script: echo "Not running any tests for a debug build."
117119

118-
# Ubuntu Linux with glibc using clang++-3.7
120+
# Ubuntu Linux with glibc using clang++-3.7, no-debug mode
119121
- stage: Test different OS/CXX/Flags
120122
os: linux
121123
sudo: false
@@ -138,6 +140,7 @@ jobs:
138140
env:
139141
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
140142
- CCACHE_CPP2=yes
143+
- EXTRA_CXXFLAGS="-DNDEBUG"
141144

142145
# Ubuntu Linux with glibc using clang++-3.7, debug mode
143146
- stage: Test different OS/CXX/Flags
@@ -165,6 +168,7 @@ jobs:
165168
- EXTRA_CXXFLAGS="-DDEBUG"
166169
script: echo "Not running any tests for a debug build."
167170

171+
# cmake build using g++-5
168172
- stage: Test different OS/CXX/Flags
169173
os: linux
170174
cache: ccache
@@ -177,20 +181,27 @@ jobs:
177181
packages:
178182
- g++-5
179183
install:
184+
- ccache -z
185+
- ccache --max-size=1G
180186
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=g++-5'
181187
- cmake --build build -- -j4
182-
script: (cd build; ctest -V -L CORE)
188+
script: (cd build; ctest -V -L CORE -j2)
183189

184190
- stage: Test different OS/CXX/Flags
185191
os: osx
186192
cache: ccache
193+
before_install:
194+
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
195+
- export PATH=/usr/local/opt/ccache/libexec:$PATH
187196
env:
188197
- BUILD_SYSTEM=cmake
189198
- CCACHE_CPP2=yes
190199
install:
200+
- ccache -z
201+
- ccache --max-size=1G
191202
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_OSX_ARCHITECTURES=x86_64'
192203
- cmake --build build -- -j4
193-
script: (cd build; ctest -V -L CORE)
204+
script: (cd build; ctest -V -L CORE -j2)
194205

195206

196207
# Run Coverity
@@ -235,6 +246,7 @@ jobs:
235246
- <<: *linter-stage
236247

237248
install:
249+
- ccache -z
238250
- ccache --max-size=1G
239251
- make -C src minisat2-download
240252
- make -C src boost-download
@@ -244,7 +256,7 @@ install:
244256

245257
script:
246258
- if [ -e bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
247-
- env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}"
259+
- env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
248260
- make -C unit "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
249261
- make -C unit test
250262

cbmc/COMPILING.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ We recommend Visual Studio.
137137
Follow these instructions:
138138

139139
1. First install Cygwin, then from the Cygwin setup facility install the
140-
following packages: `flex, bison, tar, gzip, git, make, wget, patch`.
140+
following packages: `flex, bison, tar, gzip, git, make, wget, patch,
141+
libwww-perl`.
141142
2. Get the CBMC source via
142143
```
143144
git clone https://github.com/diffblue/cbmc cbmc-git
@@ -176,6 +177,8 @@ using "make generated_files" before opening the project.
176177
There is an experimental build based on CMake instead of hand-written
177178
makefiles. It should work on a wider variety of systems than the standard
178179
makefile build, and can integrate better with IDEs and static-analysis tools.
180+
On Windows, the CMake build does not depend on Cygwin or MinGW, and doesn't
181+
require manual modification of build files.
179182
180183
1. Ensure you have all the build dependencies installed. Build dependencies are
181184
the same as for the makefile build, but with the addition of CMake version
@@ -195,9 +198,15 @@ makefile build, and can integrate better with IDEs and static-analysis tools.
195198
```
196199
You shoud also install [Homebrew](https://brew.sh), after which you can
197200
run `brew install cmake` to install CMake.
198-
- On Windows, install Cygwin, then from the Cygwin setup facility install
199-
`cmake`, `flex`, `bison`, `tar`, `gzip`, `git`, `make`, `wget`, and
200-
`patch`.
201+
- On Windows, ensure you have Visual Studio 2013 or later installed.
202+
Then, download CMake from the [official download
203+
page](https://cmake.org/download).
204+
You'll also need `git` and `patch`, which are both provided by the
205+
[git for Windows](git-scm.com/download/win) package.
206+
Finally, Windows builds of flex and bison should be installed from
207+
[the sourceforge page](sourceforge.net/projects/winflexbison).
208+
The easiest way to 'install' these executables is to unzip them and to
209+
drop the entire unzipped package into the CBMC source directory.
201210
- Use of CMake has not been tested on Solaris or FreeBSD. However, it should
202211
be possible to install CMake from the system package manager or the
203212
[official download page](https://cmake.org/download) on those systems.

cbmc/appveyor.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@ install:
1212
md deps
1313
}
1414
cd deps
15-
if (!(Test-Path bin\bison.exe)) {
16-
& appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/bison-2.4.1-bin.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1519839050&Signature=JAPFzNPMJDI4IViAVlJAEc6l8aHB3k17NpZRdoWDMLbALaJNX88vfwocuezU1tfhyrSJxfo2fTK4rgP5OULkikJs7MBZI9ovp2V%2BMT6yg87KDdH9EIOlMgltGfbP%2BoZkwBY7kXb3W5puSlt4OTE%2Bw7CRlHF9MNqFXVBqVBfa%2BGw0gXDe5Jd9qV%2BvUXZzRuBl9ERSQkSD%2B%2B%2BxFo24FZoOeYkgBHJz03%2BHuIMnlmcLgneTB2aiZZU3%2B6UTPceUxLus9%2Bksb5UbqEVaVE06TIXl76VKwqAgXM2LWaNyeJDog%2BT%2BhjW4v4ypxh6mIBo5KRNXVLPc1MxSPFQB3ITlIXv9Zg%3D%3D"
17-
& 7z x bison-2.4.1-bin.zip
18-
}
19-
if (!(Test-Path bin\flex.exe)) {
20-
& appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/flex-2.5.4a-1-bin.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1519839050&Signature=WriP8S047Mmq271ZHWL0MCPGx1gEFsuc%2BKMmChoXhXFRkn0GlIgCxZEiOu52ke9fT1kAvycWXePNBFAyCHjpF%2BJkXCwisQ6FLIf3NL%2F92849YgQKdJkDUOcZ%2Bh82XVTwNBrljKIkExkak7QEyhOf3buTC1oeuatCUV5Ez42RZjgtRiJaqcFW6xLbhfuVONr39KxH5hGx%2FDUi2RRXPbgoKDwavc9s56NP1rNbWMTE6NdNHzJeaf43E%2BSMemlVO%2BhhIY6W0f%2FtaQ7fYF%2F6YaqxdQ0sB8W5DnG4Hb%2F0CyQlrTZpGDXGr301rV0M4WBkYLmfauq4IyJsBaR095tXGW%2BzmA%3D%3D"
21-
& 7z x flex-2.5.4a-1-bin.zip
22-
}
23-
if (!(Test-Path include\FlexLexer.h)) {
24-
& appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/flex-2.5.4a-1-lib.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1519839050&Signature=H%2FLeKGv2QqKAGDTP%2F6TYPhDzuL6K%2F5dFOt61HfYBm1vUWVUNmAYVGvUAcvnUqBnhEHwZgtc8vZt1H7k3W8azxCUc7l6ZhlCDbqQ6Mg2VhfpBaQMbL1V%2BjSq5ePpWcuLMBntKk2br38PF1NtiAwCCpRTRPptaYPeGs%2BOjAH%2BN8aIIxjvj45QAgt9mcg6dfBsyfj5fdJmpHRQFuJ7%2FnsG50fmN5JDvdvmBWloB6rjxVWaN4XO6VTWZFZ34JWFyOqgWNEw9aDN3HdsSuJ0Uz19AbdwZBIWe5Elrl71rRJjn1lijCknDB7D4sAmP33k71e%2BB0qvsNl1Shuh9FkY8Z6y05Q%3D%3D"
25-
& 7z x flex-2.5.4a-1-lib.zip
26-
}
15+
appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/win_flex_bison-latest.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1543674503&Signature=CojdaOYrFl50gbxCQL%2BlfVtuo7j9v1OzfWD6jYIkfv1h7xzCacigAM51%2BVjaVx%2B8yvUjk%2B4MOU%2FKmLzev7dABWNi5n7p7SvlXYPFVVwDE57Me35Xi7BzW%2FhoSaPnVIGuhAmDfxjGoHhB0Of%2Fd2FfMl4cklGgc2YafTpFX3agNCE4dcc1UyG0SY5CbvTGTuBP%2B99zaQ69lNT1TSNUNp0PW2Hhj%2FPylts0IdDm713RA4wcNIHvLTTppBiNwMm0y%2B0qRG1op3R4vc5gahz%2B6dTUnCevYWO5l%2FIvmXQyo4XNkgqLKIRgk4wisLjtSuRh5vPyD%2FQPOrn2ubT53YnDcW6geA%3D%3D"
16+
7z x win_flex_bison-latest.zip -y
17+
Move-Item win_bison.exe bin\bison.exe -force
18+
Move-Item win_flex.exe bin\flex.exe -force
19+
Move-Item FlexLexer.h include\FlexLexer.h -force
20+
Move-Item data bin\data -force
21+
bison -V
22+
flex -V
2723
if (!(Test-Path bin\iconv.exe)) {
2824
& appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/libiconv-1.9.2-1-bin.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1519839050&Signature=sS3Y2lC1oWOhBDsL8C9ASuO4LOM%2BpB%2F8PwG5w5CdB9JnPfLqhb3FnA1zkkZJoSNuIYS3DM6CN2qxoWjpJbLEtVQe0PpxziQZjLpJw2MpxXdJiJHRDu8x9THgzwuZ3ze5BWHzPoCBQPdRkKzVPezf1HwptUsm3Y9c2jlWljQjhc8NVsI4iPmjEOwT8E%2BYpR5fsLs2GsRjuoyqKa%2Bi4JJ6MbpXVX1IgR4fzp1Li9SnE39ujHDb%2FyI3c96eCdVm1Oa6jNxzSJNfq%2FgOZM8BIxlR55a%2BtM3oBQhU0voEtDOABwuO7ZBay8dLt%2FG5vz1%2Bi%2FIlRLFxQfICaprPLzw6pXRm8Q%3D%3D"
2925
& 7z x libiconv-1.9.2-1-bin.zip
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc --unwind 5
44
^EXIT=0$
@@ -7,3 +7,6 @@ main.c
77
--
88
^warning: ignoring
99
^\[.*<builtin-library-
10+
--
11+
Knownbug added because this test triggers an invariant in cover.cpp
12+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc1/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -12,3 +12,6 @@ main.c
1212
^\*\* .* of .* covered \(100.0%\)$
1313
--
1414
^warning: ignoring
15+
--
16+
Knownbug added because this test triggers an invariant in cover.cpp
17+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc10/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -10,3 +10,6 @@ main.c
1010
^\*\* .* of .* covered \(100.0%\)$
1111
--
1212
^warning: ignoring
13+
--
14+
Knownbug added because this test triggers an invariant in cover.cpp
15+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc11/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -12,3 +12,6 @@ main.c
1212
^\*\* .* of .* covered \(100.0%\)$
1313
--
1414
^warning: ignoring
15+
--
16+
Knownbug added because this test triggers an invariant in cover.cpp
17+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc12/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -15,3 +15,6 @@ main.c
1515
^\*\* .* of .* covered \(100.0%\)$
1616
--
1717
^warning: ignoring
18+
--
19+
Knownbug added because this test triggers an invariant in cover.cpp
20+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc13/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -10,3 +10,6 @@ main.c
1010
^\*\* .* of .* covered \(100.0%\)$
1111
--
1212
^warning: ignoring
13+
--
14+
Knownbug added because this test triggers an invariant in cover.cpp
15+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc14/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -8,3 +8,6 @@ main.c
88
^\*\* .* of .* covered \(100.0%\)$
99
--
1010
^warning: ignoring
11+
--
12+
Knownbug added because this test triggers an invariant in cover.cpp
13+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc2/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -10,3 +10,6 @@ main.c
1010
^\*\* .* of .* covered \(100.0%\)$
1111
--
1212
^warning: ignoring
13+
--
14+
Knownbug added because this test triggers an invariant in cover.cpp
15+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc3/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -9,3 +9,6 @@ main.c
99
^\*\* .* of .* covered \(100.0%\)$
1010
--
1111
^warning: ignoring
12+
--
13+
Knownbug added because this test triggers an invariant in cover.cpp
14+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc4/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -11,3 +11,6 @@ main.c
1111
^\*\* .* of .* covered \(100.0%\)$
1212
--
1313
^warning: ignoring
14+
--
15+
Knownbug added because this test triggers an invariant in cover.cpp
16+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc5/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -11,3 +11,6 @@ main.c
1111
^\*\* .* of .* covered \(100.0%\)$
1212
--
1313
^warning: ignoring
14+
--
15+
Knownbug added because this test triggers an invariant in cover.cpp
16+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc6/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -8,3 +8,6 @@ main.c
88
^\*\* .* of .* covered \(100.0%\)$
99
--
1010
^warning: ignoring
11+
--
12+
Knownbug added because this test triggers an invariant in cover.cpp
13+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc7/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -10,3 +10,6 @@ main.c
1010
^\*\* .* of .* covered \(100.0%\)$
1111
--
1212
^warning: ignoring
13+
--
14+
Knownbug added because this test triggers an invariant in cover.cpp
15+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc8/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -10,3 +10,6 @@ main.c
1010
^\*\* .* of .* covered \(100.0%\)$
1111
--
1212
^warning: ignoring
13+
--
14+
Knownbug added because this test triggers an invariant in cover.cpp
15+
See #1622 for details

cbmc/regression/cbmc-cover/mcdc9/test.desc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--cover mcdc
44
^EXIT=0$
@@ -11,3 +11,6 @@ main.c
1111
^\*\* .* of .* covered \(100.0%\)$
1212
--
1313
^warning: ignoring
14+
--
15+
Knownbug added because this test triggers an invariant in cover.cpp
16+
See #1622 for details
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
public class ArithmeticExceptionTest {
2+
public static void main(String args[]) {
3+
try {
4+
int i=0;
5+
int j=10/i;
6+
}
7+
catch(Exception exc) {
8+
assert false;
9+
}
10+
}
11+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package java.lang;
2+
3+
public class ArithmeticException extends RuntimeException {
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package java.lang;
2+
3+
public class RuntimeException extends Exception {
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ArithmeticExceptionTest.class
3+
--java-throw-runtime-exceptions
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^.*assertion at file ArithmeticExceptionTest.java line 8 function.*: FAILURE$
7+
^VERIFICATION FAILED
8+
--
9+
^warning: ignoring
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
public class ArrayIndexOutOfBoundsExceptionTest {
2+
public static void main(String args[]) {
3+
try {
4+
int[] a=new int[4];
5+
a[4]=0;
6+
}
7+
catch (Exception exc) {
8+
assert false;
9+
}
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package java.lang;
2+
3+
public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package java.lang;
2+
3+
public class IndexOutOfBoundsException extends RuntimeException {
4+
}

0 commit comments

Comments
 (0)