summaryrefslogtreecommitdiffstats
path: root/test/800-smali
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2014-12-19 10:29:51 +0000
committerVladimir Marko <vmarko@google.com>2014-12-19 15:22:51 +0000
commit341e425599ba32f0776bcd294882e1e30cafa10f (patch)
tree9a2ac9cd1d9732e5d0243dcbb2474dd2e746e908 /test/800-smali
parentffda4993af78484feb7a4ce5497c1796463c0ba1 (diff)
downloadart-341e425599ba32f0776bcd294882e1e30cafa10f.zip
art-341e425599ba32f0776bcd294882e1e30cafa10f.tar.gz
art-341e425599ba32f0776bcd294882e1e30cafa10f.tar.bz2
Clean up dead loops before suspend check elimination.
Get rid of BasicBlock::KillUnreachable() and just Kill() unreachable blocks from the DFS order calculation. Bug: 18718277 Change-Id: Icaf7b9c2320530e950f87e1e2e2bd1fa5f53cb98
Diffstat (limited to 'test/800-smali')
-rw-r--r--test/800-smali/expected.txt1
-rw-r--r--test/800-smali/smali/b_18718277.smali29
-rw-r--r--test/800-smali/src/Main.java1
3 files changed, 31 insertions, 0 deletions
diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt
index 5f86f1e..a55a137 100644
--- a/test/800-smali/expected.txt
+++ b/test/800-smali/expected.txt
@@ -9,4 +9,5 @@ invoke-super abstract
BadCaseInOpRegRegReg
CmpLong
FloatIntConstPassing
+b/18718277
Done!
diff --git a/test/800-smali/smali/b_18718277.smali b/test/800-smali/smali/b_18718277.smali
new file mode 100644
index 0000000..b14ad20
--- /dev/null
+++ b/test/800-smali/smali/b_18718277.smali
@@ -0,0 +1,29 @@
+.class public LB18718277;
+
+.super Ljava/lang/Object;
+
+.method public static helper(I)I
+ .locals 1
+ add-int/lit8 v0, p0, 2
+ neg-int v0, v0
+ return v0
+.end method
+
+.method public static getInt()I
+ .registers 2
+ const/4 v1, 3
+ invoke-static {v1}, LB18718277;->helper(I)I
+ move-result v0
+ :outer_loop
+ if-eqz v1, :exit_outer_loop
+ const/4 v0, 0
+ if-eqz v0, :skip_dead_loop
+ :dead_loop
+ add-int/2addr v0, v0
+ if-gez v0, :dead_loop
+ :skip_dead_loop
+ add-int/lit8 v1, v1, -1
+ goto :outer_loop
+ :exit_outer_loop
+ return v0
+.end method
diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java
index a2db051..70641b2 100644
--- a/test/800-smali/src/Main.java
+++ b/test/800-smali/src/Main.java
@@ -65,6 +65,7 @@ public class Main {
testCases.add(new TestCase("BadCaseInOpRegRegReg", "BadCaseInOpRegRegReg", "getInt", null, null, 2));
testCases.add(new TestCase("CmpLong", "CmpLong", "run", null, null, 0));
testCases.add(new TestCase("FloatIntConstPassing", "FloatIntConstPassing", "run", null, null, 2));
+ testCases.add(new TestCase("b/18718277", "B18718277", "getInt", null, null, 0));
}
public void runTests() {