[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / tests / dtest-016.cs
index 74db1ce7c7cf855a2741ae78e2c5e67e1d571533..4ad76120c013dc11e06a8b7ea57442ecc868cc53 100644 (file)
@@ -38,6 +38,32 @@ public class C
        }
 }
 
+class D
+{
+       public static int Foo (dynamic d)
+       {
+               return 1;
+       }
+
+       public static int Foo (params object[] o)
+       {
+               return 2;
+       }
+}
+
+class E
+{
+       public static int Foo (int i, dynamic d)
+       {
+               return 1;
+       }
+
+       public static int Foo (double d, object i)
+       {
+               return 2;
+       }
+}
+
 class Program
 {
        static void DynOut (out dynamic d)
@@ -50,6 +76,11 @@ class Program
                d = null;
        }
        
+       static int DynParams (int a, int b, params int[] arr)
+       {
+               return arr [1] + b;
+       }
+       
        void TestErrorVersions ()
        {
                var c = new C ();
@@ -58,7 +89,7 @@ class Program
                c.Method_B (d); 
        }
 
-       static int Main ()
+       public static int Main ()
        {
                object o;
                DynOut (out o);
@@ -72,6 +103,21 @@ class Program
                if (C.M (ref d1, out d2) != 1)
                        return 1;
                
+               dynamic d3 = 5;
+               dynamic d4 = -9;
+               if (DynParams (1, 2, d3, d4) != -7)
+                       return 2;
+
+               if (DynParams (1, 2, 3, d4) != -7)
+                       return 3;
+               
+               d = 44;
+               if (D.Foo (d) != 1)
+                       return 4;
+
+               if (E.Foo (0, 0) != 1)
+                       return 5;
+               
                return 0;
        }
 }