diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/449-checker-bce/src/Main.java | 13 | ||||
| -rw-r--r-- | test/466-get-live-vreg/get_live_vreg_jni.cc | 8 | ||||
| -rw-r--r-- | test/466-get-live-vreg/src/Main.java | 7 | ||||
| -rw-r--r-- | test/476-checker-ctor-memory-barrier/src/Main.java | 3 |
4 files changed, 20 insertions, 11 deletions
diff --git a/test/449-checker-bce/src/Main.java b/test/449-checker-bce/src/Main.java index 6e7ba406e0..3e6d1f4d94 100644 --- a/test/449-checker-bce/src/Main.java +++ b/test/449-checker-bce/src/Main.java @@ -127,7 +127,7 @@ public class Main { } - /// CHECK-START: void Main.constantIndexing2(int[]) BCE (before) + /// CHECK-START: void Main.$opt$noinline$constantIndexing2(int[]) BCE (before) /// CHECK: BoundsCheck /// CHECK: ArraySet /// CHECK: BoundsCheck @@ -137,7 +137,7 @@ public class Main { /// CHECK: BoundsCheck /// CHECK: ArraySet - /// CHECK-START: void Main.constantIndexing2(int[]) BCE (after) + /// CHECK-START: void Main.$opt$noinline$constantIndexing2(int[]) BCE (after) /// CHECK: LessThanOrEqual /// CHECK: Deoptimize /// CHECK-NOT: BoundsCheck @@ -151,12 +151,15 @@ public class Main { /// CHECK: BoundsCheck /// CHECK: ArraySet - static void constantIndexing2(int[] array) { + static void $opt$noinline$constantIndexing2(int[] array) { array[1] = 1; array[2] = 1; array[3] = 1; array[4] = 1; array[-1] = 1; + if (array[1] == 1) { + throw new Error(""); + } } @@ -655,10 +658,10 @@ public class Main { try { assertIsManaged(); // This will cause AIOOBE. - constantIndexing2(new int[3]); + $opt$noinline$constantIndexing2(new int[3]); } catch (ArrayIndexOutOfBoundsException e) { assertIsManaged(); // This is to ensure that single-frame deoptimization works. - // Will need to be updated if constantIndexing2 is inlined. + // Will need to be updated if $opt$noinline$constantIndexing2 is inlined. try { // This will cause AIOOBE. constantIndexingForward6(new int[3]); diff --git a/test/466-get-live-vreg/get_live_vreg_jni.cc b/test/466-get-live-vreg/get_live_vreg_jni.cc index 375a3fc824..4f89e9134b 100644 --- a/test/466-get-live-vreg/get_live_vreg_jni.cc +++ b/test/466-get-live-vreg/get_live_vreg_jni.cc @@ -40,15 +40,17 @@ class TestVisitor : public StackVisitor { uint32_t value = 0; CHECK(GetVReg(m, 0, kIntVReg, &value)); CHECK_EQ(value, 42u); - } else if (m_name.compare("testIntervalHole") == 0) { + } else if (m_name.compare("$opt$noinline$testIntervalHole") == 0) { + uint32_t number_of_dex_registers = m->GetCodeItem()->registers_size_; + uint32_t dex_register_of_first_parameter = number_of_dex_registers - 2; found_method_ = true; uint32_t value = 0; if (GetCurrentQuickFrame() != nullptr && GetCurrentOatQuickMethodHeader()->IsOptimized() && !Runtime::Current()->IsDebuggable()) { - CHECK_EQ(GetVReg(m, 0, kIntVReg, &value), false); + CHECK_EQ(GetVReg(m, dex_register_of_first_parameter, kIntVReg, &value), false); } else { - CHECK(GetVReg(m, 0, kIntVReg, &value)); + CHECK(GetVReg(m, dex_register_of_first_parameter, kIntVReg, &value)); CHECK_EQ(value, 1u); } } diff --git a/test/466-get-live-vreg/src/Main.java b/test/466-get-live-vreg/src/Main.java index d036a24459..19032601fa 100644 --- a/test/466-get-live-vreg/src/Main.java +++ b/test/466-get-live-vreg/src/Main.java @@ -31,7 +31,7 @@ public class Main { } } - static void testIntervalHole(int arg, boolean test) { + static void $opt$noinline$testIntervalHole(int arg, boolean test) { // Move the argument to callee save to ensure it is in // a readable register. moveArgToCalleeSave(); @@ -44,6 +44,9 @@ public class Main { // The environment use of `arg` should not make it live. doStaticNativeCallLiveVreg(); } + if (staticField1 == 2) { + throw new Error(""); + } } static native void doStaticNativeCallLiveVreg(); @@ -67,7 +70,7 @@ public class Main { static void testWrapperIntervalHole(int arg, boolean test) { try { Thread.sleep(0); - testIntervalHole(arg, test); + $opt$noinline$testIntervalHole(arg, test); } catch (Exception e) { throw new Error(e); } diff --git a/test/476-checker-ctor-memory-barrier/src/Main.java b/test/476-checker-ctor-memory-barrier/src/Main.java index 41bec057ee..c2a2a100fb 100644 --- a/test/476-checker-ctor-memory-barrier/src/Main.java +++ b/test/476-checker-ctor-memory-barrier/src/Main.java @@ -25,13 +25,14 @@ class ClassWithoutFinals { class ClassWithFinals { public final int x; public ClassWithFinals obj; + public static boolean doThrow = false; /// CHECK-START: void ClassWithFinals.<init>(boolean) register (after) /// CHECK: MemoryBarrier kind:StoreStore /// CHECK-NEXT: ReturnVoid public ClassWithFinals(boolean cond) { x = 0; - if (cond) { + if (doThrow) { // avoid inlining throw new RuntimeException(); } |