diff options
author | jhugunin <jhugunin> | 2003-06-02 20:21:32 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-06-02 20:21:32 +0000 |
commit | e82e02a571325c67027706571995ca8df97ba035 (patch) | |
tree | d5cdccee43f9a02fe83eb9fac76b21ce8e059d91 | |
parent | e76e67fddf6081780c06faf9b602de5296f82769 (diff) | |
download | aspectj-e82e02a571325c67027706571995ca8df97ba035.tar.gz aspectj-e82e02a571325c67027706571995ca8df97ba035.zip |
added test for Bugzilla Bug 38345
VerifyError, Inconsistent stack height with try/switch/if combination
-rw-r--r-- | tests/ajcTests.xml | 6 | ||||
-rw-r--r-- | tests/bugs/TrySwitch.java | 26 | ||||
-rw-r--r-- | tests/jimTests.xml | 5 |
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 |