Fix test failure in SMART mode.
Update test 082-inline-execute to avoid a verifier issue with quickening.
An invoke-virtual is quickened into an invoke-virtual-quick. However it is
made on a "null" instance. During verification, we can't infer the method
being invoked from the vtable index since we have no access to the class. This
leads to fail on a check and abort.
Bug: 11427954
Change-Id: I740d67c72abb617db67a2c35d9be8346358f78ce
diff --git a/test/082-inline-execute/src/Main.java b/test/082-inline-execute/src/Main.java
index f4d2dd1..b881b34 100644
--- a/test/082-inline-execute/src/Main.java
+++ b/test/082-inline-execute/src/Main.java
@@ -37,6 +37,10 @@
test_String_length();
}
+ private static String nullString() {
+ return null;
+ }
+
public static void test_String_length() {
String str0 = "";
String str1 = "x";
@@ -46,7 +50,7 @@
Assert.assertEquals(str1.length(), 1);
Assert.assertEquals(str80.length(), 80);
- String strNull = null;
+ String strNull = nullString();
try {
strNull.length();
Assert.fail();
@@ -61,7 +65,7 @@
Assert.assertTrue(str0.isEmpty());
Assert.assertFalse(str1.isEmpty());
- String strNull = null;
+ String strNull = nullString();
try {
strNull.isEmpty();
Assert.fail();
@@ -88,7 +92,7 @@
} catch (StringIndexOutOfBoundsException expected) {
}
- String strNull = null;
+ String strNull = nullString();
try {
strNull.charAt(0);
Assert.fail();
@@ -133,7 +137,7 @@
Assert.assertEquals(str40.indexOf('a',10), 10);
Assert.assertEquals(str40.indexOf('b',40), -1);
- String strNull = null;
+ String strNull = nullString();
try {
strNull.indexOf('a');
Assert.fail();