summaryrefslogtreecommitdiffstats
path: root/test/407-arrays
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-10-07 14:54:48 +0100
committerNicolas Geoffray <ngeoffray@google.com>2014-10-07 14:54:48 +0100
commitb6e7206ad7a426adda9cfd649a4ef969607d79d6 (patch)
tree77d1b0434b64ba5d8569fe70b7c2711ea6ce2f70 /test/407-arrays
parent41abdb6ec97978df7c6d79abce4efb664c994ce8 (diff)
downloadart-b6e7206ad7a426adda9cfd649a4ef969607d79d6.zip
art-b6e7206ad7a426adda9cfd649a4ef969607d79d6.tar.gz
art-b6e7206ad7a426adda9cfd649a4ef969607d79d6.tar.bz2
Fix movw on x86/x86_64 to accept any 16bits immediate.
Change-Id: I282eece0cd497431f207cec61852b4585ed3655c
Diffstat (limited to 'test/407-arrays')
-rw-r--r--test/407-arrays/src/Main.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/407-arrays/src/Main.java b/test/407-arrays/src/Main.java
index b5e95b0..d5c5604 100644
--- a/test/407-arrays/src/Main.java
+++ b/test/407-arrays/src/Main.java
@@ -70,6 +70,15 @@ public class Main extends TestCase {
chars[index] = 'd';
assertEquals('d', chars[index]);
+ chars[0] = 65535;
+ assertEquals(65535, chars[0]);
+ // Do an update between the two max value updates, to avoid
+ // optimizing the second away.
+ chars[index] = 0;
+ assertEquals(0, chars[index]);
+ chars[index] = 65535;
+ assertEquals(65535, chars[index]);
+
shorts[0] = -42;
assertEquals(-42, shorts[0]);
shorts[index] = -84;
@@ -86,7 +95,13 @@ public class Main extends TestCase {
Object o2 = new Object();
objects[index] = o2;
assertEquals(o2, objects[index]);
+ // Longs are initially not supported in the linear scan register allocator
+ // on 32bits. So we call out a long helper to ensure this method gets
+ // optimized.
+ $opt$testLongWrites(longs, index);
+ }
+ public static void $opt$testLongWrites(long[] longs, int index) {
long l = -21876876876876876L;
longs[0] = l;
assertEquals(l, longs[0]);