Skip to content

Update test-gen-support from master #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2f06442
Add json->irep deserialization routine
smowton Feb 23, 2017
4cb8705
set EXIT to 10 to all failing string-solver test cases
lucasccordeiro Mar 3, 2017
bbe06ad
Java checkcast: fix stack when check disabled
smowton Nov 30, 2016
4854c9a
initial support for miniz
Feb 14, 2017
7d2536d
use amalgamated files from release tarball
Feb 23, 2017
c2a8fb2
type cleanup in miniz
Feb 23, 2017
1dd43f6
update Makefiles / remove all references to libzip/zlib
Feb 14, 2017
8e3f681
regression test with multiple JARs/classpath
Feb 14, 2017
85889e9
disable unaligned load/store for g++
Feb 23, 2017
c384ff7
auto-fix cpplint errors with generated sed script
Feb 23, 2017
7d73d66
libzip/zlib download no longer needed
Mar 8, 2017
f430ec5
Fixed compilation issues on MinGW
pkesseli Mar 8, 2017
6861a58
remove `<regex>` from unapproved headers in cpplint
Mar 9, 2017
4d31606
Use remove_instanceof in driver programs
smowton Dec 14, 2016
206f7f4
Added a side effect expr that pushes/pops Java try-catch handlers + i…
cristina-david Feb 8, 2017
ebf9002
Regression tests for exception handling
cristina-david Dec 15, 2016
a076918
Recreate the try-catch structure from the exception table
cristina-david Feb 8, 2017
33c8e37
Remove throw/try-catch and add the required instrumentation
cristina-david Dec 14, 2016
05f2233
Moved Java exceptions regression tests
cristina-david Feb 15, 2017
58a0763
Escaping brackets in test descriptions
cristina-david Feb 17, 2017
50dfffb
Fixed test description for cbmc-java/virtual7
cristina-david Feb 17, 2017
6f5d640
Recompute live ranges for local variables and add corresponding DEAD …
cristina-david Feb 28, 2017
d0d2036
Forced try-catch to start a new basic block
cristina-david Feb 28, 2017
18fa65d
Restructuring such that the exceptions instrumentation is added in on…
cristina-david Mar 2, 2017
0a11374
Add jump to the end of the current function if a function call throws…
cristina-david Mar 2, 2017
8d2a26b
Modified the expected goto-program for cbmc-java/virtual7 as exceptio…
cristina-david Mar 2, 2017
28d00eb
+ regression test for Java exception handling
cristina-david Mar 2, 2017
15fd106
allow regex to limit class files loaded from JAR
Mar 4, 2017
6de183b
support class load configuration via JSON file
Mar 7, 2017
898ba0c
add jars from JSON config to classpath
Mar 7, 2017
52952bb
add regression test
Mar 7, 2017
aec47b7
take comments into account
Mar 10, 2017
039ac4d
change from vector indices to map
Mar 10, 2017
db28587
Explore matching nested bracketed stuff
rjmunro Feb 16, 2017
32f91b8
Fix ; after } errors
rjmunro Feb 20, 2017
0f69c93
Fix missing space after , errors
rjmunro Feb 20, 2017
f1a99f7
Replace tabs globally within the line
rjmunro Feb 20, 2017
5baa807
Add space after comma globally within the line
rjmunro Mar 3, 2017
712f94f
Remove the top variable from the cfg_dominator analysis.
Feb 10, 2017
0381aab
Support for Linux based on musl-libc.
Mar 10, 2017
dcd0c52
Add test for Alpine linux (musl-libc).
Mar 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 39 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
language: cpp

sudo: false

matrix:
include:

# Alpine Linux with musl-libc using g++
- os: linux
sudo: required
compiler: gcc
services:
- docker
before_install:
- docker pull diffblue/cbmc-builder:alpine
env:
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc diffblue/cbmc-builder:alpine"
- COMPILER=g++

# OS X using g++
- os: osx
sudo: false
compiler: gcc
env: COMPILER=g++

# OS X using clang++
- os: osx
sudo: false
compiler: clang
env: COMPILER=clang++

# Ubuntu Linux with glibc using g++-5
- os: linux
sudo: false
compiler: gcc
addons:
apt:
Expand All @@ -18,7 +43,10 @@ matrix:
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
env: COMPILER=g++-5

# Ubuntu Linux with glibc using clang++-3.7
- os: linux
sudo: false
compiler: clang
addons:
apt:
Expand All @@ -34,18 +62,17 @@ matrix:
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
env: COMPILER=clang++-3.7
- os: osx
compiler: gcc
env: COMPILER=g++
- os: osx
compiler: clang
env: COMPILER=clang++

- env: NAME="CPP-LINT"
script: scripts/travis_lint.sh || true

script:
- if [ -L bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
make -C src minisat2-download &&
make -C src CXX=$COMPILER CXXFLAGS="-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare" -j2 &&
env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test &&
make -C src CXX=$COMPILER CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir
COMMAND="make -C src minisat2-download" &&
eval ${PRE_COMMAND} ${COMMAND} &&
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare\" -j2" &&
eval ${PRE_COMMAND} ${COMMAND} &&
COMMAND="env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test" &&
eval ${PRE_COMMAND} ${COMMAND} &&
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
eval ${PRE_COMMAND} ${COMMAND}
4 changes: 0 additions & 4 deletions COMPILING
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.

cd cbmc-git/src
make minisat2-download
make libzip-download zlib-download
make libzip-build
make


Expand Down Expand Up @@ -126,8 +124,6 @@ Follow these instructions:

cd cbmc-git/src
make minisat2-download
make libzip-download zlib-download
make libzip-build
make


Expand Down
Binary file modified regression/cbmc-java/NullPointer3/NullPointer3.class
Binary file not shown.
1 change: 0 additions & 1 deletion regression/cbmc-java/NullPointer3/NullPointer3.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ public static void main(String[] args)
{
throw null; // NULL pointer dereference
}

}
4 changes: 2 additions & 2 deletions regression/cbmc-java/NullPointer3/test.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CORE
NullPointer3.class
--pointer-check --stop-on-fail
--pointer-check
^EXIT=10$
^SIGNAL=0$
^ file NullPointer3.java line 5 function java::NullPointer3.main:\(\[Ljava/lang/String;\)V bytecode_index 1$
^.*Throw null: FAILURE$
^VERIFICATION FAILED$
--
^warning: ignoring
Binary file added regression/cbmc-java/exceptions1/A.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions1/B.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions1/C.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions1/D.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions1/test.class
Binary file not shown.
10 changes: 10 additions & 0 deletions regression/cbmc-java/exceptions1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CORE
test.class

^EXIT=10$
^SIGNAL=0$
^.*assertion at file test.java line 26 function.*: FAILURE$
\*\* 1 of 9 failed \(2 iterations\)$
^VERIFICATION FAILED$
--
^warning: ignoring
30 changes: 30 additions & 0 deletions regression/cbmc-java/exceptions1/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class A extends Throwable {}
class B extends A {}
class C extends B {}
class D extends C {}

public class test {
public static void main (String arg[]) {
try {
D d = new D();
C c = new C();
B b = new B();
A a = new A();
A e = a;
throw e;
}
catch(D exc) {
assert false;
}
catch(C exc) {
assert false;
}
catch(B exc) {
assert false;
}
catch(A exc) {
assert false;
}
}
}

Binary file added regression/cbmc-java/exceptions10/A.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions10/B.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions10/C.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions10/test.class
Binary file not shown.
9 changes: 9 additions & 0 deletions regression/cbmc-java/exceptions10/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
test.class

^EXIT=10$
^SIGNAL=0$
^.*assertion at file test.java line 12 function.*: FAILURE$
^VERIFICATION FAILED$
--
^warning: ignoring
25 changes: 25 additions & 0 deletions regression/cbmc-java/exceptions10/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class A extends RuntimeException {}
class B extends A {}
class C extends B {}

public class test {
static void foo() {
try {
A b = new A();
throw b;
}
catch(A exc) {
assert false;
}
}

public static void main (String args[]) {
try {
A a = new A();
foo();
}
catch(B exc) {
assert false;
}
}
}
Binary file added regression/cbmc-java/exceptions11/A.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions11/B.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions11/test.class
Binary file not shown.
9 changes: 9 additions & 0 deletions regression/cbmc-java/exceptions11/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
test.class

^EXIT=10$
^SIGNAL=0$
^.*assertion at file test.java line 36 function.*: FAILURE$
^VERIFICATION FAILED$
--
^warning: ignoring
39 changes: 39 additions & 0 deletions regression/cbmc-java/exceptions11/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
class A extends RuntimeException {
int i=1;
};

class B extends A {
};

public class test {
static int foo(int k) {
try {
if(k==0)
{
A a = new A();
throw a;
}
else
{
A b = new A();
throw b;
}

}
catch(B exc) {
assert exc.i==1;
}
return 1;
}


public static void main (String args[]) {
try {
A a = new A();
foo(6);
}
catch(A exc) {
assert exc.i==2;
}
}
}
Binary file added regression/cbmc-java/exceptions12/A.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions12/B.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions12/C.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions12/F.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions12/test.class
Binary file not shown.
9 changes: 9 additions & 0 deletions regression/cbmc-java/exceptions12/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
test.class

^EXIT=10$
^SIGNAL=0$
^.*assertion at file test.java line 12 function.*: FAILURE$
^VERIFICATION FAILED$
--
^warning: ignoring
27 changes: 27 additions & 0 deletions regression/cbmc-java/exceptions12/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class A extends RuntimeException {}
class B extends A {}
class C extends B {}

class F {
void foo() {
try {
B b = new B();
throw b;
}
catch(B exc) {
assert false;
}
}
}

public class test {
public static void main (String args[]) {
try {
F f = new F();
f.foo();
}
catch(B exc) {
assert false;
}
}
}
Binary file added regression/cbmc-java/exceptions13/A.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions13/B.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions13/C.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions13/F.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions13/test.class
Binary file not shown.
9 changes: 9 additions & 0 deletions regression/cbmc-java/exceptions13/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
test.class

^EXIT=10$
^SIGNAL=0$
^.*assertion at file test.java line 25 function.*: FAILURE$
^VERIFICATION FAILED$
--
^warning: ignoring
28 changes: 28 additions & 0 deletions regression/cbmc-java/exceptions13/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class A extends RuntimeException {}
class B extends A {}
class C extends B {}

class F {
void foo() {
try {
B b = new B();
throw b;
}
catch(B exc) {
throw exc;
}
}
}

public class test {

public static void main (String args[]) {
try {
F f = new F();
f.foo();
}
catch(B exc) {
assert false;
}
}
}
Binary file added regression/cbmc-java/exceptions14/A.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions14/B.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions14/C.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions14/test.class
Binary file not shown.
8 changes: 8 additions & 0 deletions regression/cbmc-java/exceptions14/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
test.class

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
24 changes: 24 additions & 0 deletions regression/cbmc-java/exceptions14/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class A extends RuntimeException {}
class B extends A {}
class C extends B {}

public class test {
public static void main (String args[]) {
try {
try {
C c = new C();
A a = new A();
}
catch(C exc) {
assert false;
}
catch(B exc) {
assert false;
}
}
catch(A exc) {
assert false;
}

}
}
Binary file added regression/cbmc-java/exceptions15/InetAddress.class
Binary file not shown.
Binary file not shown.
Binary file added regression/cbmc-java/exceptions15/test.class
Binary file not shown.
8 changes: 8 additions & 0 deletions regression/cbmc-java/exceptions15/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
test.class
--function test.translate
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
20 changes: 20 additions & 0 deletions regression/cbmc-java/exceptions15/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class InetAddress {}
class InetSocketAddress {}

public class test {
public String lookupPtrRecord(InetAddress address) {
return "Foo";
}

public InetAddress reverse(InetAddress address) {
return address;
}

public void translate(InetAddress address, int i) {
try {
String domainName = lookupPtrRecord(reverse(address));
} catch (Exception e) {
assert false;
}
}
}
Binary file added regression/cbmc-java/exceptions16/A.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions16/B.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions16/C.class
Binary file not shown.
Binary file added regression/cbmc-java/exceptions16/test.class
Binary file not shown.
9 changes: 9 additions & 0 deletions regression/cbmc-java/exceptions16/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
test.class
--function test.foo
^EXIT=10$
^SIGNAL=0$
^.*assertion at file test.java line 18 function.*: FAILURE$
^VERIFICATION FAILED$
--
^warning: ignoring
Loading