[tests] Test loading references from LoadFrom and LoadFile contexts
[mono-project.git] / mono / tests / dim-sharedgenerics.il
blob270ddfd375650704043fb35dae5066157002065d
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 sharedgenerics
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 sharedgenerics.exe
26 // MVID: {0DEEC74C-30FE-495C-9653-12BE5220327A}
27 .imagebase 0x00400000
28 .file alignment 0x00000200
29 .stackreserve 0x00100000
30 .subsystem 0x0003       // WINDOWS_CUI
31 .corflags 0x00000001    //  ILONLY
32 // Image base: 0x02D40000
35 // =============== CLASS MEMBERS DECLARATION ===================
37 .class interface private abstract auto ansi IFoo`1<T>
39   .method public hidebysig newslot virtual 
40           instance class [mscorlib]System.Type 
41           Foo(!T a) cil managed
42   {
43     // Code size       50 (0x32)
44     .maxstack  3
45     .locals init (class [mscorlib]System.Type V_0)
46     IL_0000:  nop
47     IL_0001:  ldstr      "At IFoo.Foo:Arg={0}, TypeOf(T)={1}"
48     IL_0006:  ldarga.s   a
49     IL_0008:  constrained. !T
50     IL_000e:  callvirt   instance string [mscorlib]System.Object::ToString()
51     IL_0013:  ldtoken    !T
52     IL_0018:  call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
53     IL_001d:  call       void [mscorlib]System.Console::WriteLine(string,
54                                                                   object,
55                                                                   object)
56     IL_0022:  nop
57     IL_0023:  ldtoken    !T
58     IL_0028:  call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
59     IL_002d:  stloc.0
60     IL_002e:  br.s       IL_0030
62     IL_0030:  ldloc.0
63     IL_0031:  ret
64   } // end of method IFoo`1::Foo
66 } // end of class IFoo`1
68 .class interface private abstract auto ansi IBar`1<- T>
70   .method public hidebysig newslot virtual 
71           instance class [mscorlib]System.Type 
72           Bar(!T b) cil managed
73   {
74     // Code size       50 (0x32)
75     .maxstack  3
76     .locals init (class [mscorlib]System.Type V_0)
77     IL_0000:  nop
78     IL_0001:  ldstr      "At IBar.Bar:Arg={0}, TypeOf(T)={1}"
79     IL_0006:  ldarga.s   b
80     IL_0008:  constrained. !T
81     IL_000e:  callvirt   instance string [mscorlib]System.Object::ToString()
82     IL_0013:  ldtoken    !T
83     IL_0018:  call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
84     IL_001d:  call       void [mscorlib]System.Console::WriteLine(string,
85                                                                   object,
86                                                                   object)
87     IL_0022:  nop
88     IL_0023:  ldtoken    !T
89     IL_0028:  call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
90     IL_002d:  stloc.0
91     IL_002e:  br.s       IL_0030
93     IL_0030:  ldloc.0
94     IL_0031:  ret
95   } // end of method IBar`1::Bar
97 } // end of class IBar`1
99 .class private auto ansi beforefieldinit FooBar`2<T,U>
100        extends [mscorlib]System.Object
101        implements class IFoo`1<!T>,
102                   class IBar`1<!U>
104   .method public hidebysig specialname rtspecialname 
105           instance void  .ctor() cil managed
106   {
107     // Code size       8 (0x8)
108     .maxstack  8
109     IL_0000:  ldarg.0
110     IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
111     IL_0006:  nop
112     IL_0007:  ret
113   } // end of method FooBar`2::.ctor
115 } // end of class FooBar`2
117 .class private auto ansi beforefieldinit Program
118        extends [mscorlib]System.Object
120   .method public hidebysig static int32  Main() cil managed
121   {
122     .entrypoint
123     // Code size       126 (0x7e)
124     .maxstack  5
125     .locals init (class FooBar`2<string,object> V_0,
126              class IFoo`1<string> V_1,
127              class IBar`1<string[]> V_2,
128              int32 V_3)
129     IL_0000:  nop
130     IL_0001:  newobj     instance void class FooBar`2<string,object>::.ctor()
131     IL_0006:  stloc.0
132     IL_0007:  ldloc.0
133     IL_0008:  stloc.1
134     IL_0009:  ldloc.0
135     IL_000a:  stloc.2
136     IL_000b:  ldstr      "Calling IFoo<string>.Foo on FooBar<string, object>"
137     + " - expecting default method IFoo<string>.Foo"
138     IL_0010:  call       void [mscorlib]System.Console::WriteLine(string)
139     IL_0015:  nop
140     IL_0016:  ldloc.1
141     IL_0017:  ldstr      "ABC"
142     IL_001c:  callvirt   instance class [mscorlib]System.Type class IFoo`1<string>::Foo(!0)
143     IL_0021:  ldtoken    [mscorlib]System.String
144     IL_0026:  call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
145     IL_002b:  call       bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
146                                                                  class [mscorlib]System.Type)
147     IL_0030:  ldstr      "Calling IFoo<string>.Foo on FooBar<string, object>"
148     IL_0035:  call       void Test::Assert(bool,
149                                            string)
150     IL_003a:  nop
151     IL_003b:  ldstr      "Calling IBar<string[]>.Foo on FooBar<string, objec"
152     + "t> - expecting default method IBar<object>.Foo"
153     IL_0040:  call       void [mscorlib]System.Console::WriteLine(string)
154     IL_0045:  nop
155     IL_0046:  ldloc.2
156     IL_0047:  ldc.i4.1
157     IL_0048:  newarr     [mscorlib]System.String
158     IL_004d:  dup
159     IL_004e:  ldc.i4.0
160     IL_004f:  ldstr      "ABC"
161     IL_0054:  stelem.ref
162     IL_0055:  callvirt   instance class [mscorlib]System.Type class IBar`1<string[]>::Bar(!0)
163     IL_005a:  ldtoken    [mscorlib]System.Object
164     IL_005f:  call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
165     IL_0064:  call       bool [mscorlib]System.Type::op_Equality(class [mscorlib]System.Type,
166                                                                  class [mscorlib]System.Type)
167     IL_0069:  ldstr      "Calling IBar<object>.Bar on FooBar<string, object>"
168     IL_006e:  call       void Test::Assert(bool,
169                                            string)
170     IL_0073:  nop
171     IL_0074:  call       int32 Test::Ret()
172     IL_0079:  stloc.3
173     IL_007a:  br.s       IL_007c
175     IL_007c:  ldloc.3
176     IL_007d:  ret
177   } // end of method Program::Main
179   .method public hidebysig specialname rtspecialname 
180           instance void  .ctor() cil managed
181   {
182     // Code size       8 (0x8)
183     .maxstack  8
184     IL_0000:  ldarg.0
185     IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
186     IL_0006:  nop
187     IL_0007:  ret
188   } // end of method Program::.ctor
190 } // end of class Program
192 .class private auto ansi beforefieldinit Test
193        extends [mscorlib]System.Object
195   .field private static bool Pass
196   .method public hidebysig static int32  Ret() cil managed
197   {
198     // Code size       19 (0x13)
199     .maxstack  1
200     .locals init (int32 V_0)
201     IL_0000:  nop
202     IL_0001:  ldsfld     bool Test::Pass
203     IL_0006:  brtrue.s   IL_000c
205     IL_0008:  ldc.i4.s   101
206     IL_000a:  br.s       IL_000e
208     IL_000c:  ldc.i4.s   0
209     IL_000e:  stloc.0
210     IL_000f:  br.s       IL_0011
212     IL_0011:  ldloc.0
213     IL_0012:  ret
214   } // end of method Test::Ret
216   .method public hidebysig static void  Assert(bool cond,
217                                                string msg) cil managed
218   {
219     // Code size       47 (0x2f)
220     .maxstack  2
221     .locals init (bool V_0)
222     IL_0000:  nop
223     IL_0001:  ldarg.0
224     IL_0002:  stloc.0
225     IL_0003:  ldloc.0
226     IL_0004:  brfalse.s  IL_0015
228     IL_0006:  nop
229     IL_0007:  ldstr      "PASS"
230     IL_000c:  call       void [mscorlib]System.Console::WriteLine(string)
231     IL_0011:  nop
232     IL_0012:  nop
233     IL_0013:  br.s       IL_002e
235     IL_0015:  nop
236     IL_0016:  ldstr      "FAIL: "
237     IL_001b:  ldarg.1
238     IL_001c:  call       string [mscorlib]System.String::Concat(string,
239                                                                 string)
240     IL_0021:  call       void [mscorlib]System.Console::WriteLine(string)
241     IL_0026:  nop
242     IL_0027:  ldc.i4.0
243     IL_0028:  stsfld     bool Test::Pass
244     IL_002d:  nop
245     IL_002e:  ret
246   } // end of method Test::Assert
248   .method public hidebysig specialname rtspecialname 
249           instance void  .ctor() cil managed
250   {
251     // Code size       8 (0x8)
252     .maxstack  8
253     IL_0000:  ldarg.0
254     IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
255     IL_0006:  nop
256     IL_0007:  ret
257   } // end of method Test::.ctor
259   .method private hidebysig specialname rtspecialname static 
260           void  .cctor() cil managed
261   {
262     // Code size       7 (0x7)
263     .maxstack  8
264     IL_0000:  ldc.i4.1
265     IL_0001:  stsfld     bool Test::Pass
266     IL_0006:  ret
267   } // end of method Test::.cctor
269 } // end of class Test
272 // =============================================================
274 // *********** DISASSEMBLY COMPLETE ***********************
275 // WARNING: Created Win32 resource file sharedgenerics.res