Fix test after inlining optimization.
Runtime.getRuntime() can now be inlined, but the test was
assuming it could not, therefore instructions would not get
licm'ed.
test: 482-checker-loop-back-edge-use
Change-Id: I19ea20c555f699673556225ecf9d945c5a91afa5
diff --git a/test/482-checker-loop-back-edge-use/src/Main.java b/test/482-checker-loop-back-edge-use/src/Main.java
index 65dfd41..86977d1 100644
--- a/test/482-checker-loop-back-edge-use/src/Main.java
+++ b/test/482-checker-loop-back-edge-use/src/Main.java
@@ -164,6 +164,12 @@
}
}
+
+ static boolean $opt$noinline$ensureSideEffects() {
+ if (doThrow) throw new Error("");
+ return true;
+ }
+
/// CHECK-START: void Main.loop9() liveness (after)
/// CHECK: <<Arg:z\d+>> StaticFieldGet liveness:<<ArgLiv:\d+>> ranges:{[<<ArgLiv>>,<<ArgLoopUse:\d+>>)} uses:[<<ArgUse:\d+>>,<<ArgLoopUse>>]
/// CHECK: If [<<Arg>>] liveness:<<IfLiv:\d+>>
@@ -178,7 +184,7 @@
// Add some code at entry to avoid having the entry block be a pre header.
// This avoids having to create a synthesized block.
System.out.println("Enter");
- while (Runtime.getRuntime() != null) {
+ while ($opt$noinline$ensureSideEffects()) {
// 'incoming' must only have a use in the inner loop.
boolean incoming = field;
while (incoming) {}
@@ -189,4 +195,5 @@
}
static boolean field;
+ static boolean doThrow = false;
}