Merge pull request #4928 from kumpera/ptr_to_struct_intrinsic
[mono.git] / mcs / tests / test-anon-94.cs
index 0c1dfa1b863e8fbb75637dfa7e365b17e00e1722..062f335c83791a1dfd3800e045ee029fa367592e 100644 (file)
@@ -1,3 +1,5 @@
+// Compiler options: -r:test-anon-94-lib.dll
+
 using System;
 
 class Program
@@ -6,6 +8,7 @@ class Program
        {
                public int i;
                public virtual void Print () { Console.WriteLine ("BaseClass.Print"); i = 90; }
+               public virtual void TestOut (out int arg) { arg = 4; }
        }
 
        public class Derived : BaseClass
@@ -15,6 +18,27 @@ class Program
                        Action a = () => base.Print ();
                        a ();
                }
+               
+               public override void TestOut (out int arg)
+               {
+                       int p = 9;
+                       Action a = () => {
+                               base.TestOut (out p);
+                               Console.WriteLine (p);
+                       };
+                       
+                       a ();
+                       arg = p;
+               }
+       }
+       
+       public class DerivedLibrary : BaseClassLibrary
+       {
+               public override void Print (int arg)
+               {
+                       Action a = () => base.Print (30);
+                       a ();
+               }
        }
 
        public static int Main ()
@@ -24,6 +48,17 @@ class Program
 
                if (d.i != 90)
                        return 1;
+               
+               int arg;
+               d.TestOut (out arg);
+               if (arg != 4)
+                       return 2;
+
+               var d2 = new DerivedLibrary ();
+               d2.Print (0);
+
+               if (d2.i != 30)
+                       return 3;
 
                return 0;
        }