Add regression test for #11362.
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 17 May 2013 15:03:25 +0000 (11:03 -0400)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 17 May 2013 15:03:40 +0000 (11:03 -0400)
mono/tests/load-exceptions.cs
mono/tests/load-missing.il

index 0c3f5146766f3f47cec68eb1df1f75017eb9b3cb..cb2fc0983757332593bf06f99e62f07cbdb0ed50 100644 (file)
@@ -325,6 +325,21 @@ public class Tests : LoadMissing {
                return 0;
        }
 
+       public static int test_0_reflection_on_field_with_missing_type () {
+               var t = typeof (BadOverridesDriver).Assembly.GetType ("FieldWithMissingType");
+               foreach (var f in t.GetFields (BindingFlags.Public | BindingFlags.Static)) {
+                       try {
+                               Console.WriteLine (f.Name);
+                               f.GetValue (null);
+                               return 1;
+                       } catch (TypeLoadException) {
+                               return 0;
+                       }
+               }
+               return 2;
+       }
+
+
        public static int Main () {
                return TestDriver.RunTests (typeof (Tests));
        }
index f85fea80e95e84a55dc81e2660d4a0098dcb19eb..dfdf0b2bc8d7f80bf97c2bcc5391160d33c3bfa7 100644 (file)
                ret\r
        }\r
 }\r
+\r
+.class public auto ansi beforefieldinit FieldWithMissingType\r
+{\r
+       .field  public [T]Missing BrokenField\r
+    .field  public static int32 WorkingField\r
+}\r