ART: Fix divide-by-zero for ARM
There was an infinite loop in the code generation for a divide
by literal zero.
Bug: 18887754
Change-Id: Ibd481918d3c6d7bc62fdd1a6807042009f561d95
diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt
index d7aede3..6cb08f4 100644
--- a/test/800-smali/expected.txt
+++ b/test/800-smali/expected.txt
@@ -12,4 +12,5 @@
b/18718277
b/18800943 (1)
b/18800943 (2)
+MoveExc
Done!
diff --git a/test/800-smali/smali/move_exc.smali b/test/800-smali/smali/move_exc.smali
new file mode 100644
index 0000000..4ade4bc
--- /dev/null
+++ b/test/800-smali/smali/move_exc.smali
@@ -0,0 +1,29 @@
+.class public LMoveExc;
+.super Ljava/lang/Object;
+
+
+.method public constructor <init>()V
+.registers 1
+ invoke-direct {p0}, Ljava/lang/Object;-><init>()V
+ return-void
+.end method
+
+.method public static run()V
+.registers 6
+:Label1
+ const v1, 15
+ const v2, 0
+ div-int v0, v1, v2
+
+:Label2
+ goto :Label4
+
+:Label3
+ move-exception v3
+ throw v3
+
+:Label4
+ return-void
+
+.catchall {:Label1 .. :Label2} :Label3
+.end method
diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java
index ea25da6..2eda850 100644
--- a/test/800-smali/src/Main.java
+++ b/test/800-smali/src/Main.java
@@ -68,6 +68,7 @@
testCases.add(new TestCase("b/18718277", "B18718277", "getInt", null, null, 0));
testCases.add(new TestCase("b/18800943 (1)", "B18800943_1", "n_a", null, new VerifyError(), 0));
testCases.add(new TestCase("b/18800943 (2)", "B18800943_2", "n_a", null, new VerifyError(), 0));
+ testCases.add(new TestCase("MoveExc", "MoveExc", "run", null, new ArithmeticException(), null));
}
public void runTests() {