From e82e02a571325c67027706571995ca8df97ba035 Mon Sep 17 00:00:00 2001 From: jhugunin Date: Mon, 2 Jun 2003 20:21:32 +0000 Subject: [PATCH] added test for Bugzilla Bug 38345 VerifyError, Inconsistent stack height with try/switch/if combination --- tests/ajcTests.xml | 6 ++++++ tests/bugs/TrySwitch.java | 26 ++++++++++++++++++++++++++ tests/jimTests.xml | 5 +++++ 3 files changed, 37 insertions(+) create mode 100644 tests/bugs/TrySwitch.java 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 @@ + + + + + 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 @@ + + + + \ No newline at end of file -- 2.39.5