Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / array_load_exception.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 extern TestDriver
7 {
8   .ver 0:0:0:0
9 }
10
11 .assembly 'test'
12 {
13   .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() =  (
14                 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
15                 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
16
17   .hash algorithm 0x00008004
18   .ver  0:0:0:0
19 }
20 .module test.exe // GUID = {36476DF0-2B03-45C8-B512-E12B67C7C094}
21
22
23   .class interface private auto ansi abstract IFoo
24   {
25
26     // method line 1
27     .method public virtual  hidebysig  newslot  abstract 
28            instance default int32 A ()  cil managed 
29     {
30         // Method begins at RVA 0x0
31     } // end of method IFoo::A
32
33   } // end of class IFoo
34
35
36   .class public auto ansi sealed Dele
37         extends [mscorlib]System.MulticastDelegate implements IFoo
38   {
39
40     // method line 5
41     .method public hidebysig  specialname  rtspecialname 
42            instance default void '.ctor' (object 'object', native int 'method')  runtime managed 
43     {
44         // Method begins at RVA 0x0
45           // Disassembly of native methods is not supported
46     } // end of method Dele::.ctor
47
48     // method line 6
49     .method public virtual  hidebysig  newslot 
50            instance default void Invoke ()  runtime managed 
51     {
52         // Method begins at RVA 0x0
53           // Disassembly of native methods is not supported
54     } // end of method Dele::Invoke
55
56     // method line 7
57     .method public virtual  hidebysig  newslot 
58            instance default class [mscorlib]System.IAsyncResult BeginInvoke (class [mscorlib]System.AsyncCallback callback, object 'object')  runtime managed 
59     {
60         // Method begins at RVA 0x0
61           // Disassembly of native methods is not supported
62     } // end of method Dele::BeginInvoke
63
64     // method line 8
65     .method public virtual  hidebysig  newslot 
66            instance default void EndInvoke (class [mscorlib]System.IAsyncResult result)  runtime managed 
67     {
68         // Method begins at RVA 0x0
69           // Disassembly of native methods is not supported
70     } // end of method Dele::EndInvoke
71
72   } // end of class Dele
73
74
75   .class private auto ansi beforefieldinit Foo
76         extends [mscorlib]System.Object
77         implements IFoo  {
78
79     // method line 2
80     .method public hidebysig  specialname  rtspecialname 
81            instance default void '.ctor' ()  cil managed 
82     {
83         // Method begins at RVA 0x20ec
84         // Code size 7 (0x7)
85         .maxstack 8
86         IL_0000:  ldarg.0 
87         IL_0001:  call instance void object::'.ctor'()
88         IL_0006:  ret 
89     } // end of method Foo::.ctor
90
91
92     // method line 4
93     .method public hidebysig 
94            instance default int32 SSS ()  cil managed 
95     {
96         // Method begins at RVA 0x20f8
97         // Code size 3 (0x3)
98         .maxstack 8
99         IL_0000:  ldc.i4.s 0x14
100         IL_0002:  ret 
101     } // end of method Foo::SSS
102
103   } // end of class Foo
104
105   .class public sequential ansi sealed beforefieldinit FooStruct extends [mscorlib]System.ValueType implements IFoo  {
106         .field public int32 blarg 
107
108   } // end of class FooStruct
109
110   .class public auto ansi beforefieldinit Tests
111         extends [mscorlib]System.Object
112   {
113     .method private static  hidebysig 
114            default void array_ldelema (class Foo& f)  cil managed 
115     {
116                 .maxstack 8
117                 ldarg.0 
118                 ldind.ref 
119                 callvirt instance int32 class Foo::SSS()
120                 pop 
121                 ret 
122     }
123
124     .method private static  hidebysig 
125            default void array_ldelema (class Foo[] arr)  cil managed 
126     {
127                 .maxstack 8
128                 ldarg.0 
129                 ldc.i4.0 
130                 ldelema Foo
131                 call void class Tests::array_ldelema([out] class Foo&)
132                 ret 
133     }
134
135     .method public static hidebysig default int32 test_0_ldelema_type_check ()  cil managed 
136     {
137                 .maxstack 2
138                 .try { 
139                         ldnull 
140                         call void class Tests::array_ldelema(class Foo[])
141                         leave BAD
142                 }
143                 catch class [mscorlib]System.TypeLoadException { // 0
144                         call void class [mscorlib]System.Console::WriteLine(object)
145                         leave GOOD
146                 }
147         BAD:
148                 ldc.i4.1
149                 ret 
150         GOOD:
151                 ldc.i4.0
152                 ret
153     }
154
155     .method public static  hidebysig default void delegate_ctor ()  cil managed 
156         {
157                 .maxstack 4
158                 .locals init (object    V_0)
159                 ldnull 
160                 ldftn void class Tests::delegate_ctor()
161                 newobj instance void class Dele::'.ctor'(object, native int)
162                 stloc.0
163                 ret 
164     }
165
166
167     // method line 3
168     .method private static  hidebysig default int32 test_0_delegate_ctor ()  cil managed 
169     {
170                 .maxstack 2
171                 .try { 
172                         ldnull 
173                         call void class Tests::delegate_ctor()
174                         leave BAD
175                 }
176                 catch class [mscorlib]System.TypeLoadException { // 0
177                         call void class [mscorlib]System.Console::WriteLine(object)
178                         leave GOOD
179                 }
180         BAD:
181                 ldc.i4.1
182                 ret 
183         GOOD:
184                 ldc.i4.0
185                 ret
186     }
187
188     .method private static  hidebysig default void generic_box<(class IFoo) T> ()  cil managed 
189     {
190                 .maxstack 3
191                 .locals init (!!T       V_0, !!T        V_1)
192                 ldloca.s 1
193                 initobj !!0
194                 ldloc.1 
195                 stloc.0 
196                 ldloca.s 0
197                 constrained. !!0
198                 callvirt instance int32 class IFoo::A()
199                 pop 
200                 ret 
201     }
202
203     .method private static  hidebysig default int32 test_0_generic_box ()  cil managed 
204     {
205                 .maxstack 2
206                 .try { 
207                         ldnull 
208                         call void class Tests::generic_box<valuetype FooStruct> ()
209                         leave BAD
210                 }
211                 catch class [mscorlib]System.TypeLoadException { // 0
212                         call void class [mscorlib]System.Console::WriteLine(object)
213                         leave GOOD
214                 }
215         BAD:
216                 ldc.i4.1
217                 ret 
218         GOOD:
219                 ldc.i4.0
220                 ret
221     }
222
223     .method private static  hidebysig 
224            default int32 Main ()  cil managed 
225     {
226                 .entrypoint
227
228                 ldtoken Tests
229                 call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
230                 call int32 class [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type)
231                 ret 
232
233         }
234 }
235