2010-04-07 Jb Evain <jbevain@novell.com>
[mcs.git] / ilasm / tests / gen-instr1.il
blobe71cf9f75a814f8e2468f4fe6440307539ce3ecf
1 // Test for type parameter as an operand for
2 // a type instr
3 // Here, initobj and box have operand : !0 
5 .assembly extern mscorlib
7   .ver 2:0:0:0
9 .assembly 'gpr'
11   .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() =  (
12                 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
13                 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
15   .ver  0:0:0:0
17 .module gpr.dll
19   .class private auto ansi beforefieldinit g`1<T>
20         extends [mscorlib]System.Object
21   {
22     .method public hidebysig  specialname  rtspecialname 
23            instance default void .ctor ()  cil managed 
24     {
25         .maxstack 8
26         IL_0000:  ldarg.0 
27         IL_0001:  call instance void object::.ctor()
28         IL_0006:  ret 
29     }
31     .method public static  hidebysig 
32            default void foo ()  cil managed 
33     {
34         .maxstack 2
35         .locals init (
36                 !0      V_0,
37                 object  V_1,
38                 !0 V_2)
39         IL_0000:  ldloca.s 2
40         IL_0002:  initobj !0
41         IL_0008:  ldloc.2 
42         IL_0009:  box !0
43         IL_000e:  stloc.1 
44         IL_000f:  ret 
45     }
47   }