diff options
author | Jeff Hao <jeffhao@google.com> | 2015-03-20 18:11:45 -0700 |
---|---|---|
committer | Jeff Hao <jeffhao@google.com> | 2015-03-20 18:40:32 -0700 |
commit | 9ccd151d0d27a729f88af9d00285afe4d147981a (patch) | |
tree | edfef268a0ecda957dfaa91ec35dd99c9ad3761f /test/800-smali | |
parent | 3743174267159ec0c39bce1ca28c2081468dda94 (diff) | |
download | art-9ccd151d0d27a729f88af9d00285afe4d147981a.zip art-9ccd151d0d27a729f88af9d00285afe4d147981a.tar.gz art-9ccd151d0d27a729f88af9d00285afe4d147981a.tar.bz2 |
Fix verifier handling of empty switch as last instruction.
Also fixes optimizing compiler's assumption that switch is non-empty and
adds test case.
Bug: 19827056
Change-Id: I5ac891d5062f528ef3be787b1094cba7b4c0fbd0
Diffstat (limited to 'test/800-smali')
-rw-r--r-- | test/800-smali/expected.txt | 1 | ||||
-rw-r--r-- | test/800-smali/smali/EmptySparseSwitch.smali | 17 | ||||
-rw-r--r-- | test/800-smali/src/Main.java | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt index 019dc14..5922257 100644 --- a/test/800-smali/expected.txt +++ b/test/800-smali/expected.txt @@ -14,4 +14,5 @@ b/18800943 (1) b/18800943 (2) MoveExc MoveExceptionOnEntry +EmptySparseSwitch Done! diff --git a/test/800-smali/smali/EmptySparseSwitch.smali b/test/800-smali/smali/EmptySparseSwitch.smali new file mode 100644 index 0000000..29592c1 --- /dev/null +++ b/test/800-smali/smali/EmptySparseSwitch.smali @@ -0,0 +1,17 @@ +.class public LEmptySparseSwitch; + +.super Ljava/lang/Object; + +.method public static run()V + .registers 2 + + const v0, 0 + + sparse-switch v0, :SparseSwitch + + return-void + + :SparseSwitch + .sparse-switch + .end sparse-switch +.end method diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java index b23896d..3e0b1f9 100644 --- a/test/800-smali/src/Main.java +++ b/test/800-smali/src/Main.java @@ -77,6 +77,8 @@ public class Main { null)); testCases.add(new TestCase("MoveExceptionOnEntry", "MoveExceptionOnEntry", "moveExceptionOnEntry", new Object[]{0}, new VerifyError(), null)); + testCases.add(new TestCase("EmptySparseSwitch", "EmptySparseSwitch", "run", null, null, + null)); } public void runTests() { |