--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java 2019-03-12 08:10:09.655794051 +0100 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java 2019-03-12 08:10:09.295791720 +0100 @@ -24,6 +24,8 @@ package org.graalvm.compiler.replacements.test; +import static org.junit.Assume.assumeFalse; + import org.graalvm.compiler.core.test.GraalCompilerTest; import org.junit.Test; import org.junit.runner.RunWith; @@ -31,6 +33,7 @@ import java.util.ArrayList; import java.util.Collection; +import jdk.vm.ci.aarch64.AArch64; @RunWith(value = Parameterized.class) public abstract class StringIndexOfTestBase extends GraalCompilerTest { @@ -44,6 +47,25 @@ String[] utf16targets = new String[]{"grga " + ((char) 0x10D) + "varak", "grga", ((char) 0x10D) + "varak"}; addTargets(tests, targets); addTargets(tests, utf16targets); + + // Check long targets + // Checkstyle: stop + String lipsum = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata "; + // Checkstyle: resume + String lipsumUTF16 = lipsum + ((char) 0x10D); + int[] subStringLengths = {7, 8, 15, 16, 31, 32, 63, 64}; + for (int len : subStringLengths) { + String target = lipsum.substring(50, 50 + len); + tests.add(new Object[]{lipsum, target}); + tests.add(new Object[]{lipsum, target + "X"}); + tests.add(new Object[]{lipsumUTF16, target}); + tests.add(new Object[]{lipsumUTF16, target + "X"}); + tests.add(new Object[]{lipsumUTF16, target + ((char) 0x10D)}); + } + tests.add(new Object[]{ + "\u0100\u0101\u0102\u0103\u0104\u0105\u0106\u0107\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff\u0108\u0109\u010a\u010b\u010c", + "\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff"}); + return tests; } @@ -99,6 +121,7 @@ @Test public void testStringBuilderIndexOfConstant() { + assumeFalse("Disabled on AArch64 due to issues on AArch64; see GR-13100 or JDK-8215792", getTarget().arch instanceof AArch64); /* * Put a copy of the target string in the space after the current string to detect cases * where we search too far. @@ -111,6 +134,7 @@ @Test public void testStringBuilderIndexOfConstantOffset() { + assumeFalse("Disabled on AArch64 due to issues on AArch64; see GR-13100 or JDK-8215792", getTarget().arch instanceof AArch64); /* * Put a copy of the target string in the space after the current string to detect cases * where we search too far.