Skip to content

Commit c98c9df

Browse files
authored
Merge branch 'develop' into cbmc_trace_options
2 parents 180e066 + 569c854 commit c98c9df

File tree

545 files changed

+2980
-1599
lines changed

Some content is hidden

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

545 files changed

+2980
-1599
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "jbmc/lib/java-models-library"]
2+
path = jbmc/lib/java-models-library
3+
url = https://github.com/diffblue/java-models-library.git

.travis.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ jobs:
229229
- ccache -z
230230
- ccache --max-size=1G
231231
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-5'
232+
- git submodule update --init --recursive
232233
- cmake --build build -- -j4
233234
script: (cd build; ctest -V -L CORE -j2)
234235

@@ -254,6 +255,7 @@ jobs:
254255
- ccache -z
255256
- ccache --max-size=1G
256257
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-7'
258+
- git submodule update --init --recursive
257259
- cmake --build build -- -j4
258260
script: (cd build; ctest -V -L CORE -j2)
259261

@@ -287,6 +289,7 @@ jobs:
287289
- ccache -z
288290
- ccache --max-size=1G
289291
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/clang++-6.0' '-DCMAKE_CXX_FLAGS=-Qunused-arguments'
292+
- git submodule update --init --recursive
290293
- cmake --build build -- -j4
291294
script: (cd build; ctest -V -L CORE -j2)
292295

@@ -305,6 +308,7 @@ jobs:
305308
- ccache -z
306309
- ccache --max-size=1G
307310
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_OSX_ARCHITECTURES=x86_64'
311+
- git submodule update --init --recursive
308312
- cmake --build build -- -j4
309313
script: (cd build; ctest -V -L CORE -j2)
310314

@@ -328,7 +332,7 @@ jobs:
328332
name: "diffblue/cbmc"
329333
description: "Travis build of ${TRAVIS_COMMIT}"
330334
notification_email: "[email protected]"
331-
build_command_prepend: "make -C jbmc/src java-models-library-download"
335+
build_command_prepend: "make -C jbmc/src setup-submodules"
332336
build_command_prepend: "make -C src minisat2-download"
333337
build_command: "make -C src -j2; make -C jbmc/src -j2"
334338
branch_pattern: "develop"
@@ -349,7 +353,7 @@ jobs:
349353
install:
350354
- ccache -z
351355
- ccache --max-size=1G
352-
- make -C jbmc/src java-models-library-download
356+
- make -C jbmc/src setup-submodules
353357
- make -C src minisat2-download
354358
- make -C src/ansi-c library_check
355359
- make -C src/cpp library_check

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ set_target_properties(
8181
xml
8282

8383
java_bytecode
84+
java-models-library
8485
jbmc
8586
jbmc-lib
8687
janalyzer

CODING_STANDARD.md

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ Formatting is enforced using clang-format. For more information about this, see
9595
# Naming
9696
- Identifiers may use the characters `[a-z0-9_]` and should start with a
9797
lower-case letter (parameters in constructors may start with `_`).
98+
- Omit names of parameters or exception objects when they are not used. If
99+
parameter names help documenting an interface, keep the name and use
100+
`(void)parameter_name;` in the body of the method.
98101
- Use American spelling for identifiers.
99102
- Separate basic words by `_`
100103
- Avoid abbreviations (e.g. prefer `symbol_table` to `st`).

COMPILING.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
6666

6767
5. To compile JBMC, do
6868
```
69-
make -C jbmc/src java-models-library-download
69+
make -C jbmc/src setup-submodules
7070
make -C jbmc/src
7171
```
7272

@@ -92,7 +92,7 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
9292
```
9393
4. To compile JBMC, type
9494
```
95-
gmake -C jbmc/src java-models-library-download
95+
gmake -C jbmc/src setup-submodules
9696
gmake -C jbmc/src
9797
```
9898

@@ -118,7 +118,7 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
118118
```
119119
4. To compile JBMC, do
120120
```
121-
gmake -C jbmc/src java-models-library-download
121+
gmake -C jbmc/src setup-submodules
122122
gmake -C jbmc/src
123123
```
124124

@@ -144,7 +144,7 @@ Follow these instructions:
144144
```
145145
4. To compile JBMC, do
146146
```
147-
make -C jbmc/src java-models-library-download
147+
make -C jbmc/src setup-submodules
148148
make -C jbmc/src
149149
```
150150

@@ -185,9 +185,9 @@ Follow these instructions:
185185
make -C src DOWNLOADER=wget minisat2-download
186186
make -C src
187187
```
188-
5. To compile JMBC, open the Cygwin shell and type
188+
5. To compile JBMC, open the Cygwin shell and type
189189
```
190-
make -C jbmc/src java-models-library-download
190+
make -C jbmc/src setup-submodules
191191
make -C jbmc/src
192192
```
193193
@@ -240,7 +240,11 @@ require manual modification of build files.
240240
2. Navigate to the *top level* folder of the project. This is different from
241241
the Makefile build, which requires you to navigate to the `src` directory
242242
first.
243-
3. Generate build files with CMake:
243+
3. Update git submodules:
244+
```
245+
git submodule update --init
246+
```
247+
4. Generate build files with CMake:
244248
```
245249
cmake -H. -Bbuild
246250
```
@@ -264,7 +268,7 @@ require manual modification of build files.
264268
Finally, to enable building universal binaries on macOS, you can pass the
265269
flag `-DCMAKE_OSX_ARCHITECTURES=i386;x86_64`. If you don't supply this flag,
266270
the build will just be for the architecture of your machine.
267-
4. Run the build:
271+
5. Run the build:
268272
```
269273
cmake --build build
270274
```

appveyor.yml

+9-16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: 1.0.{build}
22
image: Visual Studio 2013
33
clone_depth: 50
44
environment:
5-
BUILD_ENV: MSVC
65
PATH: C:\projects\cbmc\deps\bin;%PATH%
76
INCLUDE: C:\projects\cbmc\deps\include
87
install:
@@ -43,23 +42,18 @@ install:
4342
& 7z x minisat2_2.2.1.orig.tar.gz
4443
&7z x minisat2_2.2.1.orig.tar
4544
}
46-
if (!(Test-Path java-models-library-master\.gitignore)) {
47-
& appveyor downloadfile https://github.com/diffblue/java-models-library/archive/master.zip -FileName jml.zip
48-
& 7z x jml.zip
49-
}
5045
cd ..
5146
5247
cache: deps
5348

5449
build_script:
5550
- cmd: |
56-
cp -r deps/java-models-library-master/src jbmc/src/java_bytecode/library
51+
make -C jbmc/src setup-submodules
5752
cp -r deps/minisat2-2.2.1 minisat-2.2.1
5853
patch -d minisat-2.2.1 -p1 < scripts/minisat-2.2.1-patch
5954
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64
60-
sed -i "s/BUILD_ENV[ ]*=.*/BUILD_ENV = MSVC/" src/config.inc
61-
make -C src -j2
62-
make -C jbmc/src -j2
55+
make -C src -j2 BUILD_ENV=MSVC
56+
make -C jbmc/src -j2 BUILD_ENV=MSVC
6357
6458
test_script:
6559
- cmd: |
@@ -81,19 +75,18 @@ test_script:
8175
rmdir /s /q goto-instrument\slice08
8276
cd ..
8377
84-
make -C regression test
78+
make -C regression test BUILD_ENV=MSVC
8579
86-
make -C unit all -j2
87-
make -C unit test
80+
make -C unit all -j2 BUILD_ENV=MSVC
81+
make -C unit test BUILD_ENV=MSVC
8882
8983
cd jbmc/regression
9084
rmdir /s /q jbmc\VarLengthArrayTrace1
9185
rmdir /s /q jbmc\classpath1
9286
rmdir /s /q jbmc\jar-file3
93-
rmdir /s /q jbmc\tableswitch2
9487
cd ../..
9588
96-
make -C jbmc/regression test
89+
make -C jbmc/regression test BUILD_ENV=MSVC
9790
98-
make -C jbmc/unit all -j2
99-
make -C jbmc/unit test
91+
make -C jbmc/unit all -j2 BUILD_ENV=MSVC
92+
make -C jbmc/unit test BUILD_ENV=MSVC

buildspec-windows.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@ phases:
88

99
build:
1010
commands:
11-
- 'C:\tools\cygwin\bin\sed -i "s/BUILD_ENV[ ]*=.*/BUILD_ENV = MSVC/" src/config.inc'
1211
- |
1312
$env:Path = "C:\tools\cygwin\bin;$env:Path"
1413
C:\tools\cygwin\bin\bash -c "make -C src minisat2-download DOWNLOADER=wget"
1514
1615
- |
1716
$env:Path = "C:\tools\cygwin\bin;$env:Path"
18-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -j4 -C src" '
19-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -j4 -C unit all" '
17+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -j4 -C src BUILD_ENV=MSVC" '
18+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -j4 -C unit all BUILD_ENV=MSVC" '
2019
2120
- |
2221
$env:Path = "C:\tools\cygwin\bin;$env:Path"
23-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -j4 -C jbmc/src" '
24-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -j4 -C jbmc/unit all ; exit 0" '
22+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -j4 -C jbmc/src setup-submodules" && bash -c "make -j4 -C jbmc/src BUILD_ENV=MSVC" '
23+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -j4 -C jbmc/unit all BUILD_ENV=MSVC" '
2524
2625
post_build:
2726
commands:
@@ -46,22 +45,27 @@ phases:
4645
Remove-Item goto-instrument\slice08 -Force -Recurse
4746
Remove-Item goto-analyzer/constant_propagation_nondet_rounding_mode -Force -Recurse
4847
cd ..
48+
cd jbmc/regression
49+
Remove-Item jbmc\VarLengthArrayTrace1 -Force -Recurse
50+
Remove-Item jbmc\classpath1 -Force -Recurse
51+
Remove-Item jbmc\jar-file3 -Force -Recurse
52+
cd ../..
4953
5054
- |
5155
$env:Path = "C:\tools\cygwin\bin;$env:Path"
52-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C regression test" '
56+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C regression test BUILD_ENV=MSVC" '
5357
5458
- |
5559
$env:Path = "C:\tools\cygwin\bin;$env:Path"
56-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C unit test" '
60+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C unit test BUILD_ENV=MSVC" '
5761
5862
- |
5963
$env:Path = "C:\tools\cygwin\bin;$env:Path"
60-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C jbmc/regression test ; exit 0" '
64+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C jbmc/regression test BUILD_ENV=MSVC" '
6165
6266
- |
6367
$env:Path = "C:\tools\cygwin\bin;$env:Path"
64-
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C jbmc/unit test ; exit 0" '
68+
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C jbmc/unit test BUILD_ENV=MSVC" '
6569
6670
artifacts:
6771
files:

buildspec.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ phases:
1515
commands:
1616
- echo Build started on `date`
1717
- make -C src minisat2-download
18-
- make -C jbmc/src java-models-library-download
18+
- make -C jbmc/src setup-submodules
1919
- make -C src CXX="ccache g++" -j2
2020
- make -C unit CXX="ccache g++" -j2
2121
- make -C jbmc/src CXX="ccache g++" -j2

jbmc/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
add_subdirectory(regression)
22
add_subdirectory(src)
33
add_subdirectory(unit)
4+
5+
add_custom_target(java-models-library ALL
6+
COMMAND mvn package
7+
COMMAND cp target/core-models.jar ${CMAKE_CURRENT_SOURCE_DIR}/src/java_bytecode/library/
8+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/java-models-library
9+
)

jbmc/README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@ JBMC compiles CBMC as part of its build process and as such has all the pre-requ
2727
Compilation
2828
===========
2929

30-
To compile you need to run the command:
30+
Before compilation, run the commands:
31+
32+
```bash
33+
make -C src DOWNLOADER=wget minisat2-download
34+
make -C jbmc/src setup-submodules
35+
```
36+
37+
Then compile using:
3138

3239
```bash
33-
make -C jbmc/src java-models-library-download
3440
make -C jbmc/src
3541
```
3642

jbmc/lib/java-models-library

Submodule java-models-library added at 6b422b1

jbmc/regression/Makefile

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
# For the best possible utilisation of multiple cores when
22
# running tests in parallel, it is important that these directories are
33
# listed with decreasing runtimes (i.e. longest running at the top)
4-
DIRS = janalzyer-taint \
4+
DIRS = janalyzer-taint \
55
jbmc \
66
jbmc-concurrency \
77
jbmc-cover \
88
jbmc-inheritance \
99
jbmc-strings \
1010
jdiff \
11-
string-smoke-tests \
11+
strings-smoke-tests \
1212
jbmc-generics \
1313
# Empty last line
1414

15-
# Tests under goto-gcc cannot be run on Windows, so appveyor.yml unlinks
16-
# the entire directory under Windows. This variable will contain the list
17-
# of directories that actually exist on the current platform.
18-
PLATFORM_DIRS = $(wildcard $(DIRS))
19-
2015
# Run all test directories in sequence
2116
.PHONY: test
2217
test:
23-
@for dir in $(PLATFORM_DIRS); do \
18+
@for dir in $(DIRS); do \
2419
$(MAKE) "$$dir" || exit 1; \
2520
done;
2621

2722
# Pattern to execute a single test suite directory
28-
.PHONY: $(PLATFORM_DIRS)
29-
$(PLATFORM_DIRS):
23+
.PHONY: $(DIRS)
24+
$(DIRS):
3025
@echo "Running $@..." ;
3126
$(MAKE) -C "$@" test || exit 1;
3227

@@ -42,7 +37,7 @@ test-parallel:
4237
--linebuffer \
4338
--jobs $(JOBS) \
4439
$(MAKE) "{}" \
45-
::: $(PLATFORM_DIRS)
40+
::: $(DIRS)
4641

4742

4843
.PHONY: clean
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
A.class
3-
--function 'A.me:()V' --java-threading --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar`
3+
--function 'A.me:()V' --java-threading --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --lazy-methods
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL

jbmc/regression/jbmc-cover/generics/test.desc

-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ file AbstractTest.java line 18 .* SATISFIED
77
file AbstractTest.java line 19 .* SATISFIED
88
file AbstractTest.java line 20 .* SATISFIED
99
file AbstractTest.java line 21 .* SATISFIED
10-
11-
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
TestClass.class
3-
--function TestClass.testFunction --classpath ../../../src/java_bytecode/library/core-models.jar:.
3+
--function TestClass.testFunction --classpath `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar`
44
EXIT=0
55
SIGNAL=0
66
VERIFICATION SUCCESSFUL

jbmc/regression/jbmc-strings/CharacterGetNumericValue/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--refine-strings --string-max-length 1000
3+
--max-nondet-string-length 1000
44
^EXIT=10$
55
^SIGNAL=0$
66
assertion at file test.java line 8 .* SUCCESS$
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
CORE
22
Test.class
3-
--function Test.testme
3+
--no-refine-strings --function Test.testme
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
77
--
88
type mismatch
99
--
1010
Before cbmc#2472 this would assume that StringBuilder's direct parent was
11-
java.lang.Object, causing a type mismatch when --refine-strings was not in use
11+
java.lang.Object, causing a type mismatch when --no-refine-strings was in use
1212
(which at the time would assume that parent-child relationship)

jbmc/regression/jbmc-strings/RegexMatches01/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FUTURE
22
RegexMatches01.class
3-
--refine-strings --string-max-length 1000 --unwind 100
3+
--max-nondet-string-length 1000 --unwind 100
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

0 commit comments

Comments
 (0)