summaryrefslogtreecommitdiffstats
path: root/test/015-switch
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-08-06 10:09:01 -0700
committerAndreas Gampe <agampe@google.com>2014-08-06 13:04:08 -0700
commit48971b3242e5126bcd800cc9c68df64596b43d13 (patch)
tree1c288e0f42c526e04b72157e5df1361394de40c9 /test/015-switch
parent484e2c2d3531e5bb36f0e1e12f26c708939c6579 (diff)
downloadart-48971b3242e5126bcd800cc9c68df64596b43d13.zip
art-48971b3242e5126bcd800cc9c68df64596b43d13.tar.gz
art-48971b3242e5126bcd800cc9c68df64596b43d13.tar.bz2
ART: Generate chained compare-and-branch for short switches
Refactor Mir2Lir to generate chained compare-and-branch sequences for short switches on all architectures. Change-Id: Ie2a572ae69d462ba68a119e9fb93ae538cddd08f
Diffstat (limited to 'test/015-switch')
-rw-r--r--test/015-switch/expected.txt6
-rw-r--r--test/015-switch/src/Main.java10
2 files changed, 16 insertions, 0 deletions
diff --git a/test/015-switch/expected.txt b/test/015-switch/expected.txt
index ca3b518..91b4714 100644
--- a/test/015-switch/expected.txt
+++ b/test/015-switch/expected.txt
@@ -8,3 +8,9 @@ CORRECT (not found)
CORRECT (default only)
CORRECT big sparse / first
CORRECT big sparse / last
+default
+254
+255
+256
+257
+default
diff --git a/test/015-switch/src/Main.java b/test/015-switch/src/Main.java
index 7198e2b..dd97a8c 100644
--- a/test/015-switch/src/Main.java
+++ b/test/015-switch/src/Main.java
@@ -101,5 +101,15 @@ public class Main {
case 100: System.out.print("CORRECT big sparse / last\n"); break;
default: System.out.print("blah!\n"); break;
}
+
+ for (a = 253; a <= 258; a++) {
+ switch (a) {
+ case 254: System.out.println("254"); break;
+ case 255: System.out.println("255"); break;
+ case 256: System.out.println("256"); break;
+ case 257: System.out.println("257"); break;
+ default: System.out.println("default"); break;
+ }
+ }
}
}