Skip to content

Commit 8888c0e

Browse files
author
thk123
committed
Adding test to ensure methods on return type of opaque function
These methods should be loaded for all classes where an instance might be seen and the return of an opaque method is one such instance.
1 parent 293ceff commit 8888c0e

File tree

14 files changed

+56
-0
lines changed

14 files changed

+56
-0
lines changed
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public class Bar {
2+
public int x;
3+
4+
public void cproverNondetInitialize() {
5+
6+
}
7+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Baz {
2+
public void cproverNondetInitialize() {
3+
4+
}
5+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
public class Foo {
2+
public Bar subType;
3+
4+
public Baz[] arraySubtype;
5+
6+
public Gen<GenFiller> genSubtype;
7+
8+
public void cproverNondetInitialize() {
9+
10+
}
11+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public class Gen<T> {
2+
T t;
3+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public class GenFiller {
2+
public int i;
3+
4+
public void cproverNondetInitialize() {
5+
6+
}
7+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public class Opaque
2+
{
3+
static Foo opaqueMethod() {
4+
return null;
5+
}
6+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class TestClass {
2+
public static void testFunction() {
3+
int x = Opaque.opaqueMethod().subType.x;
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
TestClass.class
3+
--function TestClass.testFunction --lazy-methods --verbosity 10
4+
CI lazy methods: elaborate java::Foo\.cproverNondetInitialize:\(\)V
5+
CI lazy methods: elaborate java::Bar\.cproverNondetInitialize:\(\)V
6+
CI lazy methods: elaborate java::Baz\.cproverNondetInitialize:\(\)V
7+
CI lazy methods: elaborate java::GenFiller\.cproverNondetInitialize:\(\)V
8+
--
9+
--
10+
Testing that the return type of an opaque method is correctly elaborated. The
11+
cproverNondetInitialize should be loaded for all classes where an instance might
12+
be seen.

0 commit comments

Comments
 (0)