2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / mini / exceptions.cs
index 714d1ec88f16d140b907974ed387d371b6a4c0da..0f42f004fc6058c884855dabf1c79f533164300a 100644 (file)
@@ -1064,6 +1064,20 @@ class Tests {
                if (failed)
                        return 9;
 
+               try {
+                       ulong ul = (long)(System.Int32.MaxValue) + 1;
+                       failed = true;
+                       checked {
+                               a = (int)ul;
+                       }
+               }
+               catch (OverflowException) {
+                       failed = false;
+               }
+               if (failed)
+                       return 10;
+
+
                {
                        int i; 
                        float f = 1.1f;
@@ -2080,6 +2094,15 @@ class Tests {
                                ThrowClass.rethrow2 ();
                        }
                        catch (Exception ex) {
+                               // Check that each catch clause has its own exception variable
+                               // If not, the throw below will overwrite the exception used
+                               // by the rethrow
+                               try {
+                                       throw new DivideByZeroException ();
+                               }
+                               catch (Exception foo) {
+                               }
+
                                throw;
                        }
                }