summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-02-16 12:47:06 +0000
committer Vladimir Marko <vmarko@google.com> 2017-02-16 14:13:34 +0000
commit3e86bb035fc52bee2d277c71b57d8d40d1577b7f (patch)
tree03584a4d4f50f76993742e47f358150d5b8f296f
parentc898aa8d2865197cbeefc63d8ec78d93c305c68e (diff)
Fix 624-checker-stringops for PIC.
Do not rely on the const-string "x" to be non-throwing; just pull the "x" out of the loop to make it irrelevant. (The non-PIC test was "lucky" because "x" is a boot image string and HLoadString/kBootImageAddress in non-throwing. In PIC mode, the HLoadString/kBssEntry is throwing; the "is in boot image" optimization for HLoadClass has not been implemented for HLoadString.) Test: testrunner.py --host -t 624 Test: testrunner.py --host --pictest -t 624 Change-Id: Iff5cfb1276af0e4896707f19a18e6053afd87a77
-rw-r--r--test/624-checker-stringops/src/Main.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/624-checker-stringops/src/Main.java b/test/624-checker-stringops/src/Main.java
index 75b782e8c0..63da4f5560 100644
--- a/test/624-checker-stringops/src/Main.java
+++ b/test/624-checker-stringops/src/Main.java
@@ -232,8 +232,9 @@ public class Main {
/// CHECK-NOT: InvokeVirtual intrinsic:StringStringIndexOfAfter
static int bufferDeadLoop() {
StringBuffer b = new StringBuffer();
+ String x = "x";
for (int i = 0; i < 10; i++) {
- int d = b.toString().indexOf("x", 1);
+ int d = b.toString().indexOf(x, 1);
}
return b.length();
}
@@ -252,8 +253,9 @@ public class Main {
/// CHECK-NOT: InvokeVirtual intrinsic:StringStringIndexOfAfter
static int builderDeadLoop() {
StringBuilder b = new StringBuilder();
+ String x = "x";
for (int i = 0; i < 10; i++) {
- int d = b.toString().indexOf("x", 1);
+ int d = b.toString().indexOf(x, 1);
}
return b.length();
}