summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ajcTests.xml6
-rw-r--r--tests/bugs/TrySwitch.java26
-rw-r--r--tests/jimTests.xml5
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index 59ff49255..1419fc198 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -6382,4 +6382,10 @@
<compile files="p1/Base.java,p2/Derived.java"/>
<run class="p2.Derived"/>
</ajc-test>
+
+ <ajc-test dir="bugs" pr="38345" keywords="purejava"
+ title="try switch VerifyError, InconsistentStackHeight">
+ <compile files="TrySwitch.java"/>
+ <run class="TrySwitch"/>
+ </ajc-test>
</suite>
diff --git a/tests/bugs/TrySwitch.java b/tests/bugs/TrySwitch.java
new file mode 100644
index 000000000..b767f09bc
--- /dev/null
+++ b/tests/bugs/TrySwitch.java
@@ -0,0 +1,26 @@
+public class TrySwitch {
+ public static void main(String[] args) throws Throwable {
+ m(10);
+ }
+
+ static boolean done = true;
+ static int m(int i) {
+ try {
+ switch(i) {
+ default: return 10;
+ case 10:
+ if (false) {
+ break;
+ } else {
+ throw new RuntimeException();
+ }
+ case 11: break;
+ }
+ } catch (Throwable e) {
+ System.err.println("caught: " + e);
+ }
+ return 33;
+ }
+}
+
+
diff --git a/tests/jimTests.xml b/tests/jimTests.xml
index 80a883ac8..353042abe 100644
--- a/tests/jimTests.xml
+++ b/tests/jimTests.xml
@@ -1,4 +1,9 @@
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
<suite>
+ <ajc-test dir="bugs" pr="38345" keywords="purejava"
+ title="try switch VerifyError, InconsistentStackHeight">
+ <compile files="TrySwitch.java"/>
+ <run class="TrySwitch"/>
+ </ajc-test>
</suite> \ No newline at end of file