Fix LLVM linker flags for 6.0.
[mono-project.git] / mcs / tests / dtest-016.cs
blob4ad76120c013dc11e06a8b7ea57442ecc868cc53
1 using System;
3 class Foo
5 public virtual void Dyn (out dynamic o)
7 o = null;
11 class Bar : Foo
13 public override void Dyn (out dynamic o)
15 base.Dyn (out o);
19 public class C
21 public void Method_A (ref int i)
25 public void Method_B (ref dynamic i)
29 public static int M (string a, string b)
31 return 5;
34 public static int M (ref object o, out dynamic d)
36 d = null;
37 return 1;
41 class D
43 public static int Foo (dynamic d)
45 return 1;
48 public static int Foo (params object[] o)
50 return 2;
54 class E
56 public static int Foo (int i, dynamic d)
58 return 1;
61 public static int Foo (double d, object i)
63 return 2;
67 class Program
69 static void DynOut (out dynamic d)
71 d = null;
74 static void DynRef (ref object d)
76 d = null;
79 static int DynParams (int a, int b, params int[] arr)
81 return arr [1] + b;
84 void TestErrorVersions ()
86 var c = new C ();
87 dynamic d = null;
88 c.Method_A (d);
89 c.Method_B (d);
92 public static int Main ()
94 object o;
95 DynOut (out o);
97 dynamic d = null;
98 DynRef (ref d);
100 dynamic d1 = 1, d2;
102 // This should not involve runtime binder
103 if (C.M (ref d1, out d2) != 1)
104 return 1;
106 dynamic d3 = 5;
107 dynamic d4 = -9;
108 if (DynParams (1, 2, d3, d4) != -7)
109 return 2;
111 if (DynParams (1, 2, 3, d4) != -7)
112 return 3;
114 d = 44;
115 if (D.Foo (d) != 1)
116 return 4;
118 if (E.Foo (0, 0) != 1)
119 return 5;
121 return 0;