Merge pull request #5406 from kumpera/fix_12157
[mono.git] / mono / tests / generic-ldtoken.2.il
1 .assembly extern mscorlib
2 {
3   .ver 2:0:0:0
4   .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
5 }
6 .assembly 'generic-ldtoken.2'
7 {
8   .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() =  (
9                 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
10                 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
11
12   .hash algorithm 0x00008004
13   .ver  0:0:0:0
14 }
15 .module 'generic-ldtoken.2.exe' // GUID = {816E886F-1485-43E8-AC46-501D301BC67A}
16
17
18   .class public auto ansi beforefieldinit ClassA
19         extends [mscorlib]System.Object
20   {
21
22     // method line 1
23     .method public hidebysig  specialname  rtspecialname 
24            instance default void '.ctor' ()  cil managed 
25     {
26         // Method begins at RVA 0x20ec
27         // Code size 7 (0x7)
28         .maxstack 8
29         IL_0000:  ldarg.0 
30         IL_0001:  call instance void object::'.ctor'()
31         IL_0006:  ret 
32     } // end of method ClassA::.ctor
33
34   } // end of class ClassA
35
36   .class public auto ansi beforefieldinit Gen`1<T>
37         extends [mscorlib]System.Object
38   {
39
40     // method line 2
41     .method public hidebysig  specialname  rtspecialname 
42            instance default void '.ctor' ()  cil managed 
43     {
44         // Method begins at RVA 0x20f4
45         // Code size 7 (0x7)
46         .maxstack 8
47         IL_0000:  ldarg.0 
48         IL_0001:  call instance void object::'.ctor'()
49         IL_0006:  ret 
50     } // end of method Gen`1::.ctor
51
52     // method line 3
53     .method public hidebysig 
54            instance default class [mscorlib]System.Type typeOfT ()  cil managed 
55     {
56         // Method begins at RVA 0x20fc
57         // Code size 11 (0xb)
58         .maxstack 8
59         IL_0000:  ldtoken !T
60                   nop
61         IL_0005:  call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
62         IL_000a:  ret 
63     } // end of method Gen`1::typeOfT
64
65     // method line 4
66     .method public hidebysig 
67            instance default class [mscorlib]System.Type typeOfGenT ()  cil managed 
68     {
69         // Method begins at RVA 0x2108
70         // Code size 11 (0xb)
71         .maxstack 8
72         IL_0000:  ldtoken class Gen`1<!T>
73                   nop
74         IL_0005:  call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
75         IL_000a:  ret 
76     } // end of method Gen`1::typeOfGenT
77
78   } // end of class Gen`1
79
80   .class public auto ansi beforefieldinit main
81         extends [mscorlib]System.Object
82   {
83
84     // method line 5
85     .method public hidebysig  specialname  rtspecialname 
86            instance default void '.ctor' ()  cil managed 
87     {
88         // Method begins at RVA 0x2114
89         // Code size 7 (0x7)
90         .maxstack 8
91         IL_0000:  ldarg.0 
92         IL_0001:  call instance void object::'.ctor'()
93         IL_0006:  ret 
94     } // end of method main::.ctor
95
96     // method line 6
97     .method public static  hidebysig 
98            default int32 Main ()  cil managed 
99     {
100         // Method begins at RVA 0x211c
101         .entrypoint
102         // Code size 54 (0x36)
103         .maxstack 9
104         .locals init (
105                 class Gen`1<class ClassA>       V_0)
106         IL_0000:  newobj instance void class Gen`1<class ClassA>::'.ctor'()
107         IL_0005:  stloc.0 
108         IL_0006:  ldloc.0 
109         IL_0007:  callvirt instance class [mscorlib]System.Type class Gen`1<class ClassA>::typeOfT()
110         IL_000c:  ldtoken ClassA
111         IL_0011:  call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
112         IL_0016:  beq IL_001d
113
114         IL_001b:  ldc.i4.1 
115         IL_001c:  ret 
116         IL_001d:  ldloc.0 
117         IL_001e:  callvirt instance class [mscorlib]System.Type class Gen`1<class ClassA>::typeOfGenT()
118         IL_0023:  ldtoken class Gen`1<class ClassA>
119         IL_0028:  call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
120         IL_002d:  beq IL_0034
121
122         IL_0032:  ldc.i4.1 
123         IL_0033:  ret 
124         IL_0034:  ldc.i4.0 
125         IL_0035:  ret 
126     } // end of method main::Main
127
128   } // end of class main
129