forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariancesmall.il
More file actions
368 lines (325 loc) · 10.8 KB
/
Copy pathvariancesmall.il
File metadata and controls
368 lines (325 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 4:0:0:0
}
.assembly 'variancesmall'
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
.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
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 )
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.assembly extern xunit.core {}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003
.corflags 0x00000001
.class interface private abstract auto ansi I`1<-S>
{
.method public hidebysig newslot abstract virtual
instance string Print(!S 'value') cil managed
{
}
}
.class public auto ansi beforefieldinit CBase
extends [mscorlib]System.Object
{
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
}
}
.class public auto ansi beforefieldinit CDerived
extends CBase
{
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void CBase::.ctor()
IL_0006: ret
}
}
.class public sequential ansi sealed beforefieldinit MyStruct2
extends [mscorlib]System.ValueType
implements class I`1<object>,
class I`1<class CDerived>
{
.field public int32 n
.method public hidebysig newslot virtual final
instance string Print(class CDerived 'value') cil managed
{
.maxstack 3
.locals init (string V_0)
IL_0000: nop
IL_0001: ldarg.0
IL_0002: dup
IL_0003: ldfld int32 MyStruct2::n
IL_0008: ldc.i4.1
IL_0009: add
IL_000a: stfld int32 MyStruct2::n
IL_000f: ldstr "Print(CDerived)"
IL_0014: stloc.0
IL_0015: br.s IL_0017
IL_0017: ldloc.0
IL_0018: ret
}
.method public hidebysig newslot virtual final
instance string Print(object 'value') cil managed
{
.maxstack 3
.locals init (string V_0)
IL_0000: nop
IL_0001: ldarg.0
IL_0002: dup
IL_0003: ldfld int32 MyStruct2::n
IL_0008: ldc.i4.1
IL_0009: add
IL_000a: stfld int32 MyStruct2::n
IL_000f: ldstr "Print(object)"
IL_0014: stloc.0
IL_0015: br.s IL_0017
IL_0017: ldloc.0
IL_0018: ret
}
}
.class private auto ansi beforefieldinit Conversion`2<.ctor (class I`1<!TCBase>) TMyStruct,TCBase>
extends [mscorlib]System.Object
{
.field public !TCBase 'value'
.method public hidebysig instance string
Caller1() cil managed
{
.maxstack 2
.locals init (!TMyStruct V_0,
string V_1,
!TMyStruct V_2)
IL_0000: nop
IL_0001: ldloca.s V_2
IL_0003: initobj !TMyStruct
IL_0009: ldloc.2
IL_000a: box !TMyStruct
IL_000f: brfalse.s IL_001c
IL_0011: ldloca.s V_2
IL_0013: initobj !TMyStruct
IL_0019: ldloc.2
IL_001a: br.s IL_0021
IL_001c: call !!0 [mscorlib]System.Activator::CreateInstance<!TMyStruct>()
IL_0021: stloc.0
IL_0022: ldloca.s V_0
IL_0024: ldarg.0
IL_0025: ldfld !1 class Conversion`2<!TMyStruct,!TCBase>::'value'
IL_002a: constrained. !TMyStruct
IL_0030: callvirt instance string class I`1<!TCBase>::Print(!0)
IL_0035: stloc.1
IL_0036: br.s IL_0038
IL_0038: ldloc.1
IL_0039: ret
}
.method public hidebysig instance string
Caller2(!TMyStruct& 'instance') cil managed
{
.maxstack 2
.locals init (string V_0)
IL_0000: nop
IL_0001: ldarg.1
IL_0002: ldarg.0
IL_0003: ldfld !1 class Conversion`2<!TMyStruct,!TCBase>::'value'
IL_0008: constrained. !TMyStruct
IL_000e: callvirt instance string class I`1<!TCBase>::Print(!0)
IL_0013: stloc.0
IL_0014: br.s IL_0016
IL_0016: ldloc.0
IL_0017: ret
}
.method public hidebysig instance string
Caller3(!TMyStruct& 'instance',
!TCBase param) cil managed
{
.maxstack 2
.locals init (string V_0)
IL_0000: nop
IL_0001: ldarg.1
IL_0002: ldarg.2
IL_0003: constrained. !TMyStruct
IL_0009: callvirt instance string class I`1<!TCBase>::Print(!0)
IL_000e: stloc.0
IL_000f: br.s IL_0011
IL_0011: ldloc.0
IL_0012: ret
}
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
}
}
.class private auto ansi beforefieldinit Program
extends [mscorlib]System.Object
{
.method private hidebysig static int32
Verification(string res1,
string res2,
string res3,
string expected,
int32 n) cil managed
{
.maxstack 2
.locals init (int32 V_0,
bool V_1)
IL_0000: nop
IL_0001: ldstr " "
IL_0006: ldarg.0
IL_0007: call string [mscorlib]System.String::Concat(string,
string)
IL_000c: call void [System.Console]System.Console::WriteLine(string)
IL_0011: nop
IL_0012: ldstr " "
IL_0017: ldarg.1
IL_0018: call string [mscorlib]System.String::Concat(string,
string)
IL_001d: call void [System.Console]System.Console::WriteLine(string)
IL_0022: nop
IL_0023: ldstr " "
IL_0028: ldarg.2
IL_0029: call string [mscorlib]System.String::Concat(string,
string)
IL_002e: call void [System.Console]System.Console::WriteLine(string)
IL_0033: nop
IL_0034: ldstr " "
IL_0039: ldarg.s n
IL_003b: box [mscorlib]System.Int32
IL_0040: call string [mscorlib]System.String::Concat(object,
object)
IL_0045: call void [System.Console]System.Console::WriteLine(string)
IL_004a: nop
IL_004b: ldarg.0
IL_004c: ldarg.3
IL_004d: call bool [mscorlib]System.String::op_Equality(string,
string)
IL_0052: brfalse.s IL_0070
IL_0054: ldarg.1
IL_0055: ldarg.3
IL_0056: call bool [mscorlib]System.String::op_Equality(string,
string)
IL_005b: brfalse.s IL_0070
IL_005d: ldarg.2
IL_005e: ldarg.3
IL_005f: call bool [mscorlib]System.String::op_Equality(string,
string)
IL_0064: brfalse.s IL_0070
IL_0066: ldarg.s n
IL_0068: ldc.i4.2
IL_0069: ceq
IL_006b: ldc.i4.0
IL_006c: ceq
IL_006e: br.s IL_0071
IL_0070: ldc.i4.1
IL_0071: stloc.1
IL_0072: ldloc.1
IL_0073: brtrue.s IL_0085
IL_0075: nop
IL_0076: ldstr "PASS\n"
IL_007b: call void [System.Console]System.Console::WriteLine(string)
IL_0080: nop
IL_0081: ldc.i4.0
IL_0082: stloc.0
IL_0083: br.s IL_0094
IL_0085: ldstr "FAIL\n"
IL_008a: call void [System.Console]System.Console::WriteLine(string)
IL_008f: nop
IL_0090: ldc.i4.1
IL_0091: stloc.0
IL_0092: br.s IL_0094
IL_0094: ldloc.0
IL_0095: ret
}
.method private hidebysig static int32
Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 6
.locals init (int32 V_0,
valuetype MyStruct2 V_2,
class Conversion`2<valuetype MyStruct2,class CBase> V_12,
string V_21,
string V_22,
string V_23,
int32 V_24)
IL_0000: nop
IL_0001: ldc.i4.0
IL_0002: stloc.0
IL_000b: ldloca.s V_2
IL_000d: initobj MyStruct2
IL_005a: newobj instance void class Conversion`2<valuetype MyStruct2,class CBase>::.ctor()
IL_005f: stloc.s V_12
IL_00e2: ldstr "TEST2:"
IL_00e7: call void [System.Console]System.Console::WriteLine(string)
IL_00ec: nop
IL_00ed: ldloc.s V_12
IL_00ef: callvirt instance string class Conversion`2<valuetype MyStruct2,class CBase>::Caller1()
IL_00f4: stloc.s V_21
IL_00f6: ldloc.s V_12
IL_00f8: ldloca.s V_2
IL_00fa: callvirt instance string class Conversion`2<valuetype MyStruct2,class CBase>::Caller2(!0&)
IL_00ff: stloc.s V_22
IL_0101: ldloc.s V_12
IL_0103: ldloca.s V_2
IL_0105: newobj instance void class CBase::.ctor()
IL_010a: callvirt instance string class Conversion`2<valuetype MyStruct2,class CBase>::Caller3(!0&,
!1)
IL_010f: stloc.s V_23
IL_0111: ldloc.0
IL_0112: ldloc.s V_21
IL_0114: ldloc.s V_22
IL_0116: ldloc.s V_23
IL_0118: ldstr "Print(object)"
IL_011d: ldloca.s V_2
IL_011f: ldfld int32 MyStruct2::n
IL_0124: call int32 Program::Verification(string,
string,
string,
string,
int32)
IL_0129: add
IL_012a: stloc.0
IL_0373: ldloc.0
IL_0374: brfalse.s IL_0379
IL_0376: ldc.i4.m1
IL_0377: br.s IL_037b
IL_0379: ldc.i4.s 100
IL_037b: stloc.s V_24
IL_037d: br.s IL_037f
IL_037f: ldloc.s V_24
IL_0381: ret
}
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
}
}