Skip to content

Commit 7c669b2

Browse files
committed
Add lazy loading tests
1 parent d19448a commit 7c669b2

File tree

17 files changed

+98
-0
lines changed

17 files changed

+98
-0
lines changed
222 Bytes
Binary file not shown.
222 Bytes
Binary file not shown.
292 Bytes
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.class
3+
--lazy-methods --verbosity 10 --function test.main
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
elaborate java::A\.f:\(\)V
7+
--
8+
elaborate java::B\.g:\(\)V
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// The most basic lazy loading test: A::f is directly called, B::g should be unreachable
2+
3+
public class test
4+
{
5+
A a;
6+
B b;
7+
public static void main()
8+
{
9+
A.f();
10+
}
11+
}
12+
13+
class A
14+
{
15+
public static void f() {}
16+
}
17+
18+
class B
19+
{
20+
public static void g() {}
21+
}
222 Bytes
Binary file not shown.
222 Bytes
Binary file not shown.
310 Bytes
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.class
3+
--lazy-methods --verbosity 10 --function test.main
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
elaborate java::A\.f:\(\)V
7+
--
8+
elaborate java::B\.g:\(\)V
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// This test checks that because A is instantiated in main and B is not,
2+
// A::f is reachable and B::g is not
3+
4+
public class test
5+
{
6+
A a;
7+
B b;
8+
public static void main()
9+
{
10+
A a = new A();
11+
a.f();
12+
}
13+
}
14+
15+
class A
16+
{
17+
public void f() {}
18+
}
19+
20+
class B
21+
{
22+
public void g() {}
23+
}
222 Bytes
Binary file not shown.
222 Bytes
Binary file not shown.
197 Bytes
Binary file not shown.
197 Bytes
Binary file not shown.
296 Bytes
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.class
3+
--lazy-methods --verbosity 10 --function test.main
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
elaborate java::A\.f:\(\)V
7+
--
8+
elaborate java::B\.g:\(\)V
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// This test checks that because `main` has a parameter of type C, which has a field of type A,
2+
// A::f is considered reachable, but B::g is not.
3+
4+
public class test
5+
{
6+
public static void main(C c)
7+
{
8+
c.a.f();
9+
}
10+
}
11+
12+
class A
13+
{
14+
public void f() {}
15+
}
16+
17+
class B
18+
{
19+
public void g() {}
20+
}
21+
22+
class C
23+
{
24+
A a;
25+
}
26+
27+
class D
28+
{
29+
B b;
30+
}

0 commit comments

Comments
 (0)