[amd64] Make inline function in header static
[mono-project.git] / mcs / tests / test-anon-172.cs
blobc316a1ba24004592447e13a5ad4ac4b5bd46bf30
1 using System;
2 using System.Reflection.Emit;
3 using System.Reflection;
5 class MainClass
7 public static int Main ()
9 var dynMethod = new DynamicMethod ("Metoda", MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard,
10 null, Type.EmptyTypes, typeof (MainClass), true);
11 var generator = dynMethod.GetILGenerator ();
13 generator.Emit (OpCodes.Ldc_I4_7);
14 GenerateCodeCall (generator, (int a) => {
15 Console.WriteLine (a);
16 });
18 generator.Emit (OpCodes.Ret);
20 var deleg = (Action)dynMethod.CreateDelegate (typeof (Action));
21 deleg ();
22 return 0;
25 static void GenerateCodeCall<T1> (ILGenerator generator, Action<T1> a)
27 generator.Emit (OpCodes.Call, a.Method);