Merge pull request #5406 from kumpera/fix_12157
[mono.git] / mono / tests / typeload-unaligned.cs
index 5861867ec1c141691dcc334d976fee5b5588e7e9..94de8517fdb13c767aa474c7b7d3fe0fa0742be3 100644 (file)
@@ -24,13 +24,17 @@ class Y {
         Console.WriteLine("Object: " + x);
     }
 
+       static void Inner () {
+        X t1 = test();
+       System.GC.Collect();
+        System.GC.Collect();
+       System.GC.WaitForPendingFinalizers();
+        test2(t1);
+       }
+
     static int Main() {
        try {
-               X t1 = test();
-               System.GC.Collect();
-               System.GC.Collect();
-               System.GC.WaitForPendingFinalizers();
-               test2(t1);
+                       Inner ();
        } catch (TypeLoadException e) {
                Console.WriteLine ("got correct exception: {0}", e);
                return 0;