Merge branch 'master' of github.com:mono/mono
[mono.git] / mono / mini / exceptions.cs
index cf7dc613c0461c90f077bdb19ef223bc06f4bb57..4f782c9be09c03e6a83260a2088124f0ef3b507c 100644 (file)
@@ -2568,5 +2568,57 @@ class Tests {
 
                return 2;
        }
+
+    class Child
+    {
+        public virtual long Method()
+        {
+            throw new Exception();
+        }
+    }
+
+       /* #612206 */
+       public static int test_100_long_vars_in_clauses_initlocals_opt () {
+               Child c = new Child();
+               long value = 100; 
+               try {
+                       value = c.Method();
+               }
+               catch {}
+               return (int)value;
+       }
+
+       class A {
+               public object AnObj;
+       }
+
+       public static void DoSomething (ref object o) {
+       }
+
+       public static int test_0_ldflda_null () {
+               A a = null;
+
+               try {
+                       DoSomething (ref a.AnObj);
+               } catch (NullReferenceException) {
+                       return 0;
+               }
+
+               return 1;
+       }
+
+       unsafe struct Foo
+       {
+               public int i;
+
+               public static Foo* pFoo;
+       }
+
+       /* MS.NET doesn't seem to throw in this case */
+       public unsafe static int test_0_ldflda_null_pointer () {
+               int* pi = &Foo.pFoo->i;
+
+               return 0;
+       }
 }