From 3e86bb035fc52bee2d277c71b57d8d40d1577b7f Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 16 Feb 2017 12:47:06 +0000 Subject: 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 --- test/624-checker-stringops/src/Main.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/624-checker-stringops/src/Main.java') 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(); } -- cgit v1.2.3-59-g8ed1b