Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / constraints-load.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 'dd'
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 dd.exe // GUID = {7278218D-519A-4CA2-B185-7B5A5A3F17E7}
16
17
18   .class public auto ansi beforefieldinit Foo`1<(class [mscorlib]System.BrokenIComparable`1<!T>) T>
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 Foo`1::.ctor
33
34     // method line 2
35     .method public hidebysig 
36            instance default string Test ()  cil managed 
37     {
38         // Method begins at RVA 0x20f4
39         // Code size 2 (0x2)
40         .maxstack 8
41         IL_0000:  ldnull 
42         IL_0001:  ret 
43     } // end of method Foo`1::Test
44
45   } // end of class Foo`1
46
47   .class public auto ansi beforefieldinit Foo
48         extends [mscorlib]System.Object
49   {
50
51     // method line 3
52     .method public hidebysig  specialname  rtspecialname 
53            instance default void '.ctor' ()  cil managed 
54     {
55         // Method begins at RVA 0x20f8
56         // Code size 7 (0x7)
57         .maxstack 8
58         IL_0000:  ldarg.0 
59         IL_0001:  call instance void object::'.ctor'()
60         IL_0006:  ret 
61     } // end of method Foo::.ctor
62
63     // method line 4
64     .method public hidebysig 
65            instance default string Test<(class [mscorlib]System.BrokenIComparable`1<!!T>) T> ()  cil managed 
66     {
67         // Method begins at RVA 0x2100
68         // Code size 2 (0x2)
69         .maxstack 8
70         IL_0000:  ldnull 
71         IL_0001:  ret 
72     } // end of method Foo::Test
73
74   } // end of class Foo
75
76   .class public auto ansi abstract sealed beforefieldinit Driver
77         extends [mscorlib]System.Object
78   {
79
80     // method line 5
81     .method private static  hidebysig 
82            default void UseBrokenMethod ()  cil managed 
83     {
84         // Method begins at RVA 0x2104
85         // Code size 12 (0xc)
86         .maxstack 8
87         IL_0000:  newobj instance void class Foo::'.ctor'()
88         IL_0005:  callvirt instance string class Foo::Test<int32> ()
89         IL_000a:  pop 
90         IL_000b:  ret 
91     } // end of method Driver::UseBrokenMethod
92
93     // method line 6
94     .method private static  hidebysig 
95            default void UseBrokenType ()  cil managed 
96     {
97         // Method begins at RVA 0x2114
98         // Code size 12 (0xc)
99         .maxstack 8
100         IL_0000:  newobj instance void class Foo`1<int32>::'.ctor'()
101         IL_0005:  callvirt instance string class Foo`1<int32>::Test()
102         IL_000a:  pop 
103         IL_000b:  ret 
104     } // end of method Driver::UseBrokenType
105
106     // method line 7
107     .method private static  hidebysig 
108            default void TestMethod ()  cil managed 
109     {
110         // Method begins at RVA 0x2124
111         // Code size 47 (0x2f)
112         .maxstack 10
113         .locals init (
114                 class [mscorlib]System.Type     V_0,
115                 class [mscorlib]System.Reflection.MethodInfo    V_1,
116                 class [mscorlib]System.Type     V_2,
117                 class [mscorlib]System.Type     V_3)
118         IL_0000:  ldtoken Foo
119         IL_0005:  call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
120         IL_000a:  stloc.0 
121         IL_000b:  ldloc.0 
122         IL_000c:  ldstr "Test"
123         IL_0011:  callvirt instance class [mscorlib]System.Reflection.MethodInfo class [mscorlib]System.Type::GetMethod(string)
124         IL_0016:  stloc.1 
125         IL_0017:  ldloc.1 
126         IL_0018:  callvirt instance class [mscorlib]System.Type[] class [mscorlib]System.Reflection.MethodInfo::GetGenericArguments()
127         IL_001d:  ldc.i4.0 
128         IL_001e:  ldelem.ref 
129         IL_001f:  stloc.2 
130         IL_0020:  ldloc.2 
131         IL_0021:  callvirt instance class [mscorlib]System.Type[] class [mscorlib]System.Type::GetGenericParameterConstraints()
132         IL_0026:  ldc.i4.0 
133         IL_0027:  ldelem.ref 
134         IL_0028:  stloc.3 
135         IL_0029:  call void class Driver::UseBrokenMethod()
136         IL_002e:  ret 
137     } // end of method Driver::TestMethod
138
139     // method line 8
140     .method private static  hidebysig 
141            default void TestClass ()  cil managed 
142     {
143         // Method begins at RVA 0x2160
144         // Code size 35 (0x23)
145         .maxstack 8
146         .locals init (
147                 class [mscorlib]System.Type     V_0,
148                 class [mscorlib]System.Type     V_1,
149                 class [mscorlib]System.Type     V_2)
150         IL_0000:  ldtoken Foo`1
151         IL_0005:  call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
152         IL_000a:  stloc.0 
153         IL_000b:  ldloc.0 
154         IL_000c:  callvirt instance class [mscorlib]System.Type[] class [mscorlib]System.Type::GetGenericArguments()
155         IL_0011:  ldc.i4.0 
156         IL_0012:  ldelem.ref 
157         IL_0013:  stloc.1 
158         IL_0014:  ldloc.1 
159         IL_0015:  callvirt instance class [mscorlib]System.Type[] class [mscorlib]System.Type::GetGenericParameterConstraints()
160         IL_001a:  ldc.i4.0 
161         IL_001b:  ldelem.ref 
162         IL_001c:  stloc.2 
163         IL_001d:  call void class Driver::UseBrokenType()
164         IL_0022:  ret 
165     } // end of method Driver::TestClass
166
167     // method line 9
168     .method public static  hidebysig 
169            default int32 Main ()  cil managed 
170     {
171         // Method begins at RVA 0x2190
172         .entrypoint
173         // Code size 50 (0x32)
174         .maxstack 4
175         .locals init (
176                 int32   V_0)
177         .try { // 1
178           IL_0000:  call void class Driver::TestMethod()
179           IL_0005:  ldc.i4.1 
180           IL_0006:  stloc.0 
181           IL_0007:  leave IL_0030
182
183           IL_000c:  leave IL_0017
184
185         } // end .try 1
186         catch class [mscorlib]System.TypeLoadException { // 1
187           IL_0011:  pop 
188           IL_0012:  leave IL_0017
189
190         } // end handler 1
191         .try { // 0
192           IL_0017:  call void class Driver::TestClass()
193           IL_001c:  ldc.i4.2 
194           IL_001d:  stloc.0 
195           IL_001e:  leave IL_0030
196
197           IL_0023:  leave IL_002e
198
199         } // end .try 0
200         catch class [mscorlib]System.TypeLoadException { // 0
201           IL_0028:  pop 
202           IL_0029:  leave IL_002e
203
204         } // end handler 0
205         IL_002e:  ldc.i4.0 
206         IL_002f:  ret 
207         IL_0030:  ldloc.0 
208         IL_0031:  ret 
209     } // end of method Driver::Main
210
211   } // end of class Driver
212