Skip to content

Commit 1f06d35

Browse files
Merge pull request diffblue#312 from diffblue/pull-support-20180112
Pull support 20180112
2 parents 3d492fe + e42e97a commit 1f06d35

File tree

285 files changed

+4728
-2065
lines changed

Some content is hidden

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

285 files changed

+4728
-2065
lines changed
716 Bytes
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class InstanceOf8 {
2+
public static boolean test(Integer i) {
3+
if (i instanceof Integer) {
4+
return true;
5+
} else {
6+
return false;
7+
}
8+
}
9+
public static void main(String[] args)
10+
{
11+
assert(!test(null));
12+
assert(test(new Integer(1)));
13+
}
14+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
InstanceOf8.class
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
Binary file not shown.
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
test.class
3+
--lazy-methods --verbosity 10 --function test.g
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
elaborate java::test\.f:\(\)I
7+
VERIFICATION SUCCESSFUL
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
public class test {
3+
4+
public int f() { return 1; }
5+
6+
public static void g(test[] args) {
7+
8+
if(args == null || args.length != 1 || args[0] == null)
9+
return;
10+
asserthere.doassert(args[0].f() == 1);
11+
12+
}
13+
14+
}
15+
16+
class asserthere {
17+
18+
// Used to avoid lazy-loading currently marking any class with an
19+
// $assertionsEnabled member (i.e. any class that asserts) as needed.
20+
public static void doassert(boolean condition) { assert(condition); }
21+
22+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
test.class
3+
--lazy-methods --verbosity 10 --function test.g
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
elaborate java::test\.f:\(\)I
7+
VERIFICATION SUCCESSFUL
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
public class test {
3+
4+
public int f() { return 1; }
5+
6+
public static void g(container c) {
7+
8+
if(c == null)
9+
return;
10+
test[] args = c.test_array;
11+
if(args == null || args.length != 1 || args[0] == null)
12+
return;
13+
asserthere.doassert(args[0].f() == 1);
14+
15+
}
16+
17+
}
18+
19+
class container {
20+
public test[] test_array;
21+
}
22+
23+
class asserthere {
24+
25+
// Used to avoid lazy-loading currently marking any class with an
26+
// $assertionsEnabled member (i.e. any class that asserts) as needed.
27+
public static void doassert(boolean condition) { assert(condition); }
28+
29+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
test.class
3+
--lazy-methods --verbosity 10 --function test.g
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
elaborate java::test\.f:\(\)I
7+
VERIFICATION SUCCESSFUL
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
public class test {
3+
4+
public int f() { return 1; }
5+
6+
public static void g(container<test> c) {
7+
8+
if(c == null)
9+
return;
10+
test[] args = c.test_array;
11+
if(args == null || args.length != 1 || args[0] == null)
12+
return;
13+
asserthere.doassert(args[0].f() == 1);
14+
15+
}
16+
17+
}
18+
19+
class container<T> {
20+
public T[] test_array;
21+
}
22+
23+
class asserthere {
24+
25+
// Used to avoid lazy-loading currently marking any class with an
26+
// $assertionsEnabled member (i.e. any class that asserts) as needed.
27+
public static void doassert(boolean condition) { assert(condition); }
28+
29+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
test.class
3+
--lazy-methods --verbosity 10 --function test.g
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
elaborate java::test\.f:\(\)I
7+
VERIFICATION SUCCESSFUL
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
public class test {
3+
4+
public int f() { return 1; }
5+
6+
public static void g(container<Integer, test> c) {
7+
8+
if(c == null)
9+
return;
10+
test[] args = c.test_array;
11+
if(args == null || args.length != 1 || args[0] == null)
12+
return;
13+
asserthere.doassert(args[0].f() == 1);
14+
15+
}
16+
17+
}
18+
19+
class container<S, T> {
20+
public T[] test_array;
21+
}
22+
23+
class asserthere {
24+
25+
// Used to avoid lazy-loading currently marking any class with an
26+
// $assertionsEnabled member (i.e. any class that asserts) as needed.
27+
public static void doassert(boolean condition) { assert(condition); }
28+
29+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
KNOWNBUG
2+
test.class
3+
--lazy-methods --verbosity 10 --function test.g
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
elaborate java::test\.f:\(\)I
7+
VERIFICATION SUCCESSFUL
8+
--
9+
--
10+
The right methods are loaded, but verification is not successful
11+
because __CPROVER_start doesn't create appropriately typed input for
12+
this kind of nested generic parameter, so dynamic cast checks fail upon
13+
fetching the generic type's field.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
public class test {
3+
4+
public int f() { return 1; }
5+
6+
public static void g(container2<container<test>> c) {
7+
8+
if(c == null)
9+
return;
10+
container<test> outer = c.next;
11+
if(outer == null)
12+
return;
13+
test[] args = outer.test_array;
14+
if(args == null || args.length != 1 || args[0] == null)
15+
return;
16+
asserthere.doassert(args[0].f() == 1);
17+
18+
}
19+
20+
}
21+
22+
class container<T> {
23+
public T[] test_array;
24+
}
25+
26+
class container2<T> {
27+
public T next;
28+
}
29+
30+
class asserthere {
31+
32+
// Used to avoid lazy-loading currently marking any class with an
33+
// $assertionsEnabled member (i.e. any class that asserts) as needed.
34+
public static void doassert(boolean condition) { assert(condition); }
35+
36+
}
Binary file not shown.
Binary file not shown.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
public abstract class AbstractList<E>
2+
implements List<E>
3+
{
4+
public Iterator<E> iterator() {
5+
return new Itr();
6+
}
7+
8+
public ListIterator<E> listIterator() {
9+
return listIterator(0);
10+
}
11+
12+
public boolean equals(Object o) {
13+
if (o == this)
14+
return true;
15+
if (!(o instanceof List))
16+
return false;
17+
18+
ListIterator<E> e1 = listIterator();
19+
ListIterator<?> e2 = ((List<?>) o).listIterator();
20+
while (e1.hasNext() && e2.hasNext()) {
21+
E o1 = e1.next();
22+
Object o2 = e2.next();
23+
if (!(o1==null ? o2==null : o1.equals(o2)))
24+
return false;
25+
}
26+
return !(e1.hasNext() || e2.hasNext());
27+
}
28+
29+
private class Itr implements Iterator<E> {
30+
Itr() {
31+
}
32+
33+
public boolean hasNext() {
34+
return false;
35+
}
36+
37+
public E next() {
38+
return null;
39+
}
40+
41+
}
42+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
public class ArrayList<E> extends AbstractList<E>
2+
implements List<E>
3+
{
4+
public ListIterator<E> listIterator() {
5+
return new ListItr(0);
6+
}
7+
public ListIterator<E> listIterator(int index) {
8+
return new ListItr(index);
9+
}
10+
private class ListItr extends Itr implements ListIterator<E> {
11+
ListItr(int index) {
12+
super();
13+
}
14+
15+
public boolean hasPrevious() {
16+
return false;
17+
}
18+
}
19+
20+
private class Itr implements Iterator<E> {
21+
Itr() {
22+
}
23+
24+
public boolean hasNext() {
25+
return false;
26+
}
27+
public E next() {
28+
return null;
29+
}
30+
}
31+
}
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 ArrayListEquals {
2+
3+
public int check2(ArrayList<Integer> l1) {
4+
ArrayList<Integer> al = new ArrayList<Integer>();
5+
if(l1.equals(al))
6+
return 1;
7+
else
8+
return 0;
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+
public interface Iterator<E> {
2+
boolean hasNext();
3+
E next();
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public interface List<E> {
2+
ListIterator<E> listIterator();
3+
ListIterator<E> listIterator(int index);
4+
}
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public interface ListIterator<E> extends Iterator<E> {
2+
boolean hasNext();
3+
boolean hasPrevious();
4+
E next();
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
ArrayListEquals.class
3+
--lazy-methods --java-max-vla-length 48 --unwind 8 --java-unwind-enum-static --trace --cover location --function ArrayListEquals.check2 --show-goto-functions
4+
e2 . ArrayList\$Itr.hasNext:\(\)Z\(\);
5+
--
6+
e2 . ListIterator.hasNext:\(\)Z\(\);
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Test {
2+
public static void main(int x) {
3+
assert(x == 0);
4+
}
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test.class
3+
--trace --json-ui --trace-json-extended
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
rawLhs
7+
--
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Test.class
3+
--trace --json-ui
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
--
7+
rawLhs

regression/cbmc/memcpy1/main.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <stdint.h>
2+
#include <string.h>
3+
4+
int main()
5+
{
6+
uint8_t a;
7+
uint32_t b;
8+
9+
memcpy(&b, &a, sizeof(b));
10+
11+
return 0;
12+
}

regression/cbmc/memcpy1/test.desc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
main.c
3+
--bounds-check --pointer-check
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
\[(__builtin___memcpy_chk|memcpy)\.pointer_dereference\.16\] dereference failure: pointer outside object bounds in \*\(\(\(const char \*\)src \+ \(signed long (long )?int\)n\) - \(signed long (long )?int\)1\): FAILURE$
8+
\*\* 1 of 17 failed
9+
--
10+
^warning: ignoring

regression/cbmc/memset3/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ main.c
55
^SIGNAL=0$
66
^VERIFICATION FAILED$
77
\[.*] dereference failure: pointer outside dynamic object bounds in .*: FAILURE
8-
\*\* 1 of .* failed \(.*\)
8+
\*\* 2 of .* failed \(.*\)
99
--
1010
^warning: ignoring

0 commit comments

Comments
 (0)