Skip to content

Commit e6e24d0

Browse files
committed
Add tests for as-yet unsupported lambda types
1 parent d74cccc commit e6e24d0

10 files changed

+50
-0
lines changed
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface InterfaceDeclaringEquals {
2+
3+
public int f(int x);
4+
5+
public boolean equals(Object other);
6+
7+
}
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface InterfaceWithDefaults {
2+
3+
public int f(int x);
4+
5+
public default int g() { return 1; }
6+
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
interface StubInterface {
2+
3+
public int f(int x);
4+
5+
}
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface StubSuperinterface extends StubInterface {
2+
3+
}
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class Test {
2+
3+
public static void main() {
4+
5+
StubInterface stubInterface = (x -> x);
6+
StubSuperinterface stubSuperinterface = (x -> x);
7+
InterfaceDeclaringEquals interfaceDeclaringEquals = (x -> x);
8+
InterfaceWithDefaults interfaceWithDefaults = (x -> x);
9+
10+
}
11+
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CORE
2+
Test.class
3+
--function Test.main --verbosity 10
4+
^VERIFICATION SUCCESSFUL$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
^ignoring invokedynamic at java::Test.main:\(\)V address 0 which produces a stub type java::StubInterface
8+
^ignoring invokedynamic at java::Test.main:\(\)V address 6 which produces type java::StubSuperinterface which should have exactly one abstract method but actually has 0.
9+
^ignoring invokedynamic at java::Test.main:\(\)V address 12 which produces type java::InterfaceDeclaringEquals which should have exactly one abstract method but actually has 2.
10+
^ignoring invokedynamic at java::Test.main:\(\)V address 18 which produces type java::InterfaceWithDefaults which should have exactly one abstract method but actually has 2.
11+
--
12+
--
13+
This exercises four cases that aren't currently supported: stub interfaces, stub
14+
superinterfaces, interfaces that declare methods also declared on
15+
java.lang.Object, and interfaces that provide default methods. All we require at
16+
this point is that jbmc shouldn't crash when these are seen.

0 commit comments

Comments
 (0)