-// 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 ();
+ }
}
-}
+}