Initial set of Ward sgen annotations (#5705)
[mono.git] / mcs / tests / test-anon-26.cs
index 5a3f6a8144dc46e47cc87eaefa28a11a4bf84392..0c37e3aff2437ed081020e486a571fcf5b31e620 100644 (file)
@@ -1,28 +1,23 @@
-// Compiler options: -unsafe
-using System;
-
-delegate int D ();
-
-unsafe class X {
-
-       static int Main ()
+namespace TestGotoLabels
+{
+       class GotoLabelsTest
        {
-               D x = T (1);
+               public delegate void MyDelegate ();
 
-               int v = x ();
-               Console.WriteLine ("Should be 2={0}", v);
-               return v == 2 ? 0 : 1;
-       }
-
-       static D T (int a)
-       {
-               D d = delegate {
-                       int *x = &a;
+               public static int Main ()
+               {
+                       TestMethod2 (delegate () {
+                               goto outLabel;
+                       outLabel:
+                               return;
+                       });
 
-                       *x = *x + 1;
-                       return *x;
-               };
+                       return 0;
+               }
 
-               return d;
+               public static void TestMethod2 (MyDelegate md)
+               {
+                       md.Invoke ();
+               }
        }
-}
+}