]> source.dussan.org Git - aspectj.git/commitdiff
added test for Bugzilla Bug 38345
authorjhugunin <jhugunin>
Mon, 2 Jun 2003 20:21:32 +0000 (20:21 +0000)
committerjhugunin <jhugunin>
Mon, 2 Jun 2003 20:21:32 +0000 (20:21 +0000)
   VerifyError, Inconsistent stack height with try/switch/if combination

tests/ajcTests.xml
tests/bugs/TrySwitch.java [new file with mode: 0644]
tests/jimTests.xml

index 59ff492550864324bfece01a6cf6c054d2442b14..1419fc198adec2efb6bdd764b2a788d48d366942 100644 (file)
         <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 (file)
index 0000000..b767f09
--- /dev/null
@@ -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;
+       }
+}
+
+
index 80a883ac870f8ded053ef659e4f54e47e43b45ad..353042abe63176a53be2c53dad8969b46603d2f7 100644 (file)
@@ -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