[interp] Remove unreachable code (#12411)
[mono-project.git] / mono / tests / dim-simple.il
blobd033fb5a776006282c26bdb6b64cce77190407f5
2 //  Microsoft (R) .NET Framework IL Disassembler.  Version 4.6.1055.0
3 //  Copyright (c) Microsoft Corporation.  All rights reserved.
7 // Metadata version: v4.0.30319
8 .assembly extern mscorlib
10   .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
11   .ver 4:0:0:0
13 .assembly simple
15   .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) 
16   .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
17                                                                                                              63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 )       // ceptionThrows.
19   // --- The following custom attribute is added automatically, do not uncomment -------
20   //  .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 ) 
22   .hash algorithm 0x00008004
23   .ver 0:0:0:0
25 .module simple.exe
26 // MVID: {0B8FCFD0-673A-4DEB-90CC-B96749DE09C8}
27 .imagebase 0x00400000
28 .file alignment 0x00000200
29 .stackreserve 0x00100000
30 .subsystem 0x0003       // WINDOWS_CUI
31 .corflags 0x00000001    //  ILONLY
32 // Image base: 0x01A80000
35 // =============== CLASS MEMBERS DECLARATION ===================
37 .class interface private abstract auto ansi IBlah
39   .method public hidebysig newslot virtual 
40           instance int32  Blah(int32 c) cil managed
41   {
42     // Code size       39 (0x27)
43     .maxstack  2
44     .locals init (int32 V_0)
45     IL_0000:  nop
46     IL_0001:  ldstr      "At IBlah.Blah"
47     IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
48     IL_000b:  nop
49     IL_000c:  ldarg.1
50     IL_000d:  ldarg.0
51     IL_000e:  call       instance int32 IBlah::Blah_Private_GetA()
52     IL_0013:  add
53     IL_0014:  ldarg.0
54     IL_0015:  call       instance int32 IBlah::Blah_Internal_GetB()
55     IL_001a:  add
56     IL_001b:  ldarg.0
57     IL_001c:  call       instance int32 IBlah::Blah_Protected_GetC()
58     IL_0021:  add
59     IL_0022:  stloc.0
60     IL_0023:  br.s       IL_0025
62     IL_0025:  ldloc.0
63     IL_0026:  ret 
64   } // end of method IBlah::Blah
66   .method private hidebysig instance int32 
67           Blah_Private_GetA() cil managed
68   {
69     // Code size       18 (0x12)
70     .maxstack  1
71     .locals init (int32 V_0)
72     IL_0000:  nop
73     IL_0001:  ldstr      "At IBlah.Blah_Private_GetA"
74     IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
75     IL_000b:  nop
76     IL_000c:  ldc.i4.1
77     IL_000d:  stloc.0
78     IL_000e:  br.s       IL_0010
80     IL_0010:  ldloc.0
81     IL_0011:  ret
82   } // end of method IBlah_Impl::Blah_Private_GetA
84   .method assembly hidebysig instance int32 
85           Blah_Internal_GetB() cil managed
86   {
87     // Code size       18 (0x12)
88     .maxstack  1
89     .locals init (int32 V_0)
90     IL_0000:  nop
91     IL_0001:  ldstr      "At IBlah.Blah_Internal_GetB"
92     IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
93     IL_000b:  nop
94     IL_000c:  ldc.i4.2
95     IL_000d:  stloc.0
96     IL_000e:  br.s       IL_0010
98     IL_0010:  ldloc.0
99     IL_0011:  ret
100   } // end of method IBlah_Impl::Blah_Internal_GetB
102   .method family hidebysig instance int32 
103           Blah_Protected_GetC() cil managed
104   {
105     // Code size       18 (0x12)
106     .maxstack  1
107     .locals init (int32 V_0)
108     IL_0000:  nop
109     IL_0001:  ldstr      "At IBlah.Blah_Protected_GetC"
110     IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
111     IL_000b:  nop
112     IL_000c:  ldc.i4.3
113     IL_000d:  stloc.0
114     IL_000e:  br.s       IL_0010
116     IL_0010:  ldloc.0
117     IL_0011:  ret
118   } // end of method IBlah_Impl::Blah_Protected_GetC
119 } // end of class IBlah
121 .class interface private abstract auto ansi IFoo
123   .method public hidebysig newslot virtual 
124           instance int32  Foo(int32 a) cil managed
125   {
126     // Code size       20 (0x14)
127     .maxstack  2
128     .locals init (int32 V_0)
129     IL_0000:  nop
130     IL_0001:  ldstr      "At IFoo.Foo"
131     IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
132     IL_000b:  nop
133     IL_000c:  ldarg.1
134     IL_000d:  ldc.i4.1
135     IL_000e:  add
136     IL_000f:  stloc.0
137     IL_0010:  br.s       IL_0012
139     IL_0012:  ldloc.0
140     IL_0013:  ret
141   } // end of method IFoo::Foo
143 } // end of class IFoo
145 .class interface private abstract auto ansi IBar
147   .method public hidebysig newslot virtual 
148           instance int32  Bar(int32 b) cil managed
149   {
150     // Code size       21 (0x15)
151     .maxstack  2
152     .locals init (int32 V_0)
153     IL_0000:  nop
154     IL_0001:  ldstr      "At IBar.Bar"
155     IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
156     IL_000b:  nop
157     IL_000c:  ldarg.1
158     IL_000d:  ldc.i4.s   10
159     IL_000f:  add
160     IL_0010:  stloc.0
161     IL_0011:  br.s       IL_0013
163     IL_0013:  ldloc.0
164     IL_0014:  ret
165   } // end of method IBar::Bar
167 } // end of class IBar
169 .class private auto ansi beforefieldinit Base
170        extends [mscorlib]System.Object
171        implements IBlah
173   .method public hidebysig specialname rtspecialname 
174           instance void  .ctor() cil managed
175   {
176     // Code size       8 (0x8)
177     .maxstack  8
178     IL_0000:  ldarg.0
179     IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
180     IL_0006:  nop
181     IL_0007:  ret
182   } // end of method Base::.ctor
184 } // end of class Base
186 .class private auto ansi beforefieldinit FooBar
187        extends Base
188        implements IFoo,
189                   IBar
191   .method public hidebysig instance int32 
192           CallBlahProtected() cil managed
193   {
194     // Code size       12 (0xc)
195     .maxstack  1
196     .locals init (int32 V_0)
197     IL_0000:  nop
198     IL_0001:  ldarg.0
199     IL_0002:  call       instance int32 IBlah::Blah_Protected_GetC()
200     IL_0007:  stloc.0
201     IL_0008:  br.s       IL_000a
203     IL_000a:  ldloc.0
204     IL_000b:  ret
205   } // end of method FooBar::CallBlahProtected
207   .method public hidebysig specialname rtspecialname 
208           instance void  .ctor() cil managed
209   {
210     // Code size       8 (0x8)
211     .maxstack  8
212     IL_0000:  ldarg.0
213     IL_0001:  call       instance void Base::.ctor()
214     IL_0006:  nop
215     IL_0007:  ret
216   } // end of method FooBar::.ctor
218 } // end of class FooBar
220 .class private auto ansi beforefieldinit Program
221        extends [mscorlib]System.Object
223   .method public hidebysig static int32  Main() cil managed
224   {
225     .entrypoint
226     // Code size       158 (0x9e)
227     .maxstack  2
228     .locals init (class FooBar V_0,
229              class IFoo V_1,
230              class IBar V_2,
231              class IBlah V_3,
232              int32 V_4)
233     IL_0000:  nop
234     IL_0001:  newobj     instance void FooBar::.ctor()
235     IL_0006:  stloc.0
236     IL_0007:  ldloc.0
237     IL_0008:  stloc.1
238     IL_0009:  ldloc.0
239     IL_000a:  stloc.2
240     IL_000b:  ldloc.0
241     IL_000c:  stloc.3
242     IL_000d:  ldstr      "Calling IFoo.Foo on FooBar - expecting default met"
243     + "hod on IFoo.Foo. "
244     IL_0012:  call       void [mscorlib]System.Console::WriteLine(string)
245     IL_0017:  nop
246     IL_0018:  ldloc.1
247     IL_0019:  ldc.i4.s   10
248     IL_001b:  callvirt   instance int32 IFoo::Foo(int32)
249     IL_0020:  ldc.i4.s   11
250     IL_0022:  ceq
251     IL_0024:  ldstr      "Calling IFoo.Foo on FooBar"
252     IL_0029:  call       void Test::Assert(bool,
253                                            string)
254     IL_002e:  nop
255     IL_002f:  ldstr      "Calling IBar.Bar on FooBar - expecting default met"
256     + "hod on IBar.Bar. "
257     IL_0034:  call       void [mscorlib]System.Console::WriteLine(string)
258     IL_0039:  nop
259     IL_003a:  ldloc.2
260     IL_003b:  ldc.i4.s   10
261     IL_003d:  callvirt   instance int32 IBar::Bar(int32)
262     IL_0042:  ldc.i4.s   20
263     IL_0044:  ceq
264     IL_0046:  ldstr      "Calling IBar.Bar on FooBar"
265     IL_004b:  call       void Test::Assert(bool,
266                                            string)
267     IL_0050:  nop
268     IL_0051:  ldstr      "Calling IBlah.Blah on FooBar - expecting default m"
269     + "ethod on IBlah.Blah from Base. "
270     IL_0056:  call       void [mscorlib]System.Console::WriteLine(string)
271     IL_005b:  nop
272     IL_005c:  ldloc.3
273     IL_005d:  ldc.i4.s   10
274     IL_005f:  callvirt   instance int32 IBlah::Blah(int32)
275     IL_0064:  ldc.i4.s   16
276     IL_0066:  ceq
277     IL_0068:  ldstr      "Calling IBlah.Blah on FooBar"
278     IL_006d:  call       void Test::Assert(bool,
279                                            string)
280     IL_0072:  nop
281     IL_0073:  ldstr      "Calling FooBar.CallBlahProtected - expecting prote"
282     + "cted methods on interface can be called"
283     IL_0078:  call       void [mscorlib]System.Console::WriteLine(string)
284     IL_007d:  nop
285     IL_007e:  ldloc.0
286     IL_007f:  callvirt   instance int32 FooBar::CallBlahProtected()
287     IL_0084:  ldc.i4.3
288     IL_0085:  ceq
289     IL_0087:  ldstr      "Calling FooBar.CallBlahProtected"
290     IL_008c:  call       void Test::Assert(bool,
291                                            string)
292     IL_0091:  nop
293     IL_0092:  call       int32 Test::Ret()
294     IL_0097:  stloc.s    V_4
295     IL_0099:  br.s       IL_009b
297     IL_009b:  ldloc.s    V_4
298     IL_009d:  ret
299   } // end of method Program::Main
301   .method public hidebysig specialname rtspecialname 
302           instance void  .ctor() cil managed
303   {
304     // Code size       8 (0x8)
305     .maxstack  8
306     IL_0000:  ldarg.0
307     IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
308     IL_0006:  nop
309     IL_0007:  ret
310   } // end of method Program::.ctor
312 } // end of class Program
314 .class private auto ansi beforefieldinit Test
315        extends [mscorlib]System.Object
317   .field private static bool Pass
318   .method public hidebysig static int32  Ret() cil managed
319   {
320     // Code size       19 (0x13)
321     .maxstack  1
322     .locals init (int32 V_0)
323     IL_0000:  nop
324     IL_0001:  ldsfld     bool Test::Pass
325     IL_0006:  brtrue.s   IL_000c
327     IL_0008:  ldc.i4.s   101
328     IL_000a:  br.s       IL_000e
330     IL_000c:  ldc.i4.s   0
331     IL_000e:  stloc.0
332     IL_000f:  br.s       IL_0011
334     IL_0011:  ldloc.0
335     IL_0012:  ret
336   } // end of method Test::Ret
338   .method public hidebysig static void  Assert(bool cond,
339                                                string msg) cil managed
340   {
341     // Code size       47 (0x2f)
342     .maxstack  2
343     .locals init (bool V_0)
344     IL_0000:  nop
345     IL_0001:  ldarg.0
346     IL_0002:  stloc.0
347     IL_0003:  ldloc.0
348     IL_0004:  brfalse.s  IL_0015
350     IL_0006:  nop
351     IL_0007:  ldstr      "PASS"
352     IL_000c:  call       void [mscorlib]System.Console::WriteLine(string)
353     IL_0011:  nop
354     IL_0012:  nop
355     IL_0013:  br.s       IL_002e
357     IL_0015:  nop
358     IL_0016:  ldstr      "FAIL: "
359     IL_001b:  ldarg.1
360     IL_001c:  call       string [mscorlib]System.String::Concat(string,
361                                                                 string)
362     IL_0021:  call       void [mscorlib]System.Console::WriteLine(string)
363     IL_0026:  nop
364     IL_0027:  ldc.i4.0
365     IL_0028:  stsfld     bool Test::Pass
366     IL_002d:  nop
367     IL_002e:  ret
368   } // end of method Test::Assert
370   .method public hidebysig specialname rtspecialname 
371           instance void  .ctor() cil managed
372   {
373     // Code size       8 (0x8)
374     .maxstack  8
375     IL_0000:  ldarg.0
376     IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
377     IL_0006:  nop
378     IL_0007:  ret
379   } // end of method Test::.ctor
381   .method private hidebysig specialname rtspecialname static 
382           void  .cctor() cil managed
383   {
384     // Code size       7 (0x7)
385     .maxstack  8
386     IL_0000:  ldc.i4.1
387     IL_0001:  stsfld     bool Test::Pass
388     IL_0006:  ret
389   } // end of method Test::.cctor
391 } // end of class Test
394 // =============================================================
396 // *********** DISASSEMBLY COMPLETE ***********************
397 // WARNING: Created Win32 resource file simple.res