Use different operations to load string before loops in LICM test.
The test assertion will not hold if a compiler (D8) removes the
string load, e.g., by computing String#length at compile time:
https://r8-review.googlesource.com/c/r8/+/26540
Bug: 115968045
Bug: 113880427
Test: art/test.py --host -r -t 624-checker-stringops
Change-Id: Ibe6a4a46f534b7079ba516f27da82fec2d60f4ea
diff --git a/test/624-checker-stringops/src/Main.java b/test/624-checker-stringops/src/Main.java
index 3aa6e56..4d98df8 100644
--- a/test/624-checker-stringops/src/Main.java
+++ b/test/624-checker-stringops/src/Main.java
@@ -38,7 +38,7 @@
/// CHECK-DAG: InvokeVirtual intrinsic:StringStringIndexOf loop:none
/// CHECK-DAG: InvokeVirtual intrinsic:StringStringIndexOfAfter loop:none
static int liveIndexOf() {
- int k = ABC.length() + XYZ.length(); // does LoadString before loops
+ int k = ABC.lastIndexOf('Z') + XYZ.lastIndexOf('Z'); // does LoadString before loops
for (char c = 'A'; c <= 'Z'; c++) {
k += ABC.indexOf(c);
}
@@ -290,7 +290,7 @@
}
public static void main(String[] args) throws Exception {
- expectEquals(1865, liveIndexOf());
+ expectEquals(1863, liveIndexOf());
expectEquals(29, deadIndexOf());
try {