summaryrefslogtreecommitdiffstats
path: root/test/082-inline-execute
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-01-15 23:24:00 -0800
committerAndreas Gampe <agampe@google.com>2015-01-28 15:32:40 -0800
commit878d58cbaf6b17a9e3dcab790754527f3ebc69e5 (patch)
tree1c1af4ef938ad06a783da51e2c6276d6b0628da6 /test/082-inline-execute
parentb80c3154d3b6359d8ad4ce50d3a6a68224400cdd (diff)
downloadart-878d58cbaf6b17a9e3dcab790754527f3ebc69e5.tar.gz
art-878d58cbaf6b17a9e3dcab790754527f3ebc69e5.tar.bz2
art-878d58cbaf6b17a9e3dcab790754527f3ebc69e5.zip
ART: Arm64 optimizing compiler intrinsics
Implement most intrinsics for the optimizing compiler for Arm64. Change-Id: Idb459be09f0524cb9aeab7a5c7fccb1c6b65a707
Diffstat (limited to 'test/082-inline-execute')
-rw-r--r--test/082-inline-execute/src/Main.java63
1 files changed, 42 insertions, 21 deletions
diff --git a/test/082-inline-execute/src/Main.java b/test/082-inline-execute/src/Main.java
index 5561a09c88..bf6c802a0c 100644
--- a/test/082-inline-execute/src/Main.java
+++ b/test/082-inline-execute/src/Main.java
@@ -125,23 +125,25 @@ public class Main {
// so we need to separate out the tests that are expected to throw exception
public static void test_String_charAt() {
- String testStr = "Now is the time";
-
- Assert.assertEquals('N', testStr.charAt(0));
- Assert.assertEquals('o', testStr.charAt(1));
- Assert.assertEquals(' ', testStr.charAt(10));
- Assert.assertEquals('e', testStr.charAt(14)); // 14 = testStr.length()-1 as a constant.
- Assert.assertEquals('N', test_String_charAt_inner(testStr, 0));
- Assert.assertEquals('o', test_String_charAt_inner(testStr, 1));
- Assert.assertEquals(' ', test_String_charAt_inner(testStr, 10));
- Assert.assertEquals('e', test_String_charAt_inner(testStr, testStr.length()-1));
-
- test_String_charAtExc();
- test_String_charAtExc2();
+ String testStr = "Now is the time to test some stuff";
+
+ Assert.assertEquals(testStr.length() - 1, 33); // 33 = testStr.length()-1 as a constant.
+ Assert.assertEquals('f', testStr.charAt(33));
+
+ test_String_charAt(testStr, 'N', 'o', ' ', 'f');
+ test_String_charAt(testStr.substring(3,15), ' ', 'i', 'm', 'e');
+ }
+ public static void test_String_charAt(String testStr, char a, char b, char c, char d) {
+ Assert.assertEquals(a, testStr.charAt(0));
+ Assert.assertEquals(b, testStr.charAt(1));
+ Assert.assertEquals(c, testStr.charAt(10));
+ Assert.assertEquals(d, testStr.charAt(testStr.length()-1));
+
+ test_String_charAtExc(testStr);
+ test_String_charAtExc2(testStr);
}
- private static void test_String_charAtExc() {
- String testStr = "Now is the time";
+ private static void test_String_charAtExc(String testStr) {
try {
testStr.charAt(-1);
Assert.fail();
@@ -153,7 +155,12 @@ public class Main {
} catch (StringIndexOutOfBoundsException expected) {
}
try {
- testStr.charAt(15); // 15 = "Now is the time".length()
+ if (testStr.length() == 34) {
+ testStr.charAt(34); // 34 = "Now is the time to test some stuff".length()
+ } else {
+ Assert.assertEquals(testStr.length(), 12); // 12 = " is the time".length()
+ testStr.charAt(12);
+ }
Assert.fail();
} catch (StringIndexOutOfBoundsException expected) {
}
@@ -168,7 +175,13 @@ public class Main {
} catch (StringIndexOutOfBoundsException expected) {
}
try {
- test_String_charAt_inner(testStr, 15); // 15 = "Now is the time".length()
+ if (testStr.length() == 34) {
+ // 34 = "Now is the time to test some stuff".length()
+ test_String_charAt_inner(testStr, 34);
+ } else {
+ Assert.assertEquals(testStr.length(), 12); // 12 = " is the time".length()
+ test_String_charAt_inner(testStr, 12);
+ }
Assert.fail();
} catch (StringIndexOutOfBoundsException expected) {
}
@@ -193,19 +206,27 @@ public class Main {
return s.charAt(index);
}
- private static void test_String_charAtExc2() {
+ private static void test_String_charAtExc2(String testStr) {
try {
- test_String_charAtExc3();
+ test_String_charAtExc3(testStr);
+ Assert.fail();
+ } catch (StringIndexOutOfBoundsException expected) {
+ }
+ try {
+ test_String_charAtExc4(testStr);
Assert.fail();
} catch (StringIndexOutOfBoundsException expected) {
}
}
- private static void test_String_charAtExc3() {
- String testStr = "Now is the time";
+ private static void test_String_charAtExc3(String testStr) {
Assert.assertEquals('N', testStr.charAt(-1));
}
+ private static void test_String_charAtExc4(String testStr) {
+ Assert.assertEquals('N', testStr.charAt(100));
+ }
+
static int start;
private static int[] negIndex = { -100000 };
public static void test_String_indexOf() {