summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Methodical/nonvirtualcall/valuetype.il
blob: b7c1d1cf0445069b0f5655fdc681032671880219 (plain)
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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.





// Metadata version: v2.0.50516
.assembly extern mscorlib
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
  .ver 2:0:0:0
}
.assembly 'valuetype'
{
  .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) 
  .hash algorithm 0x00008004
  .ver 0:0:0:0
}
.module valuetype.exe
// MVID: {AF04A73C-C896-4A00-97F2-959EE06A9394}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003       // WINDOWS_CUI
.corflags 0x00000001    //  ILONLY
// Image base: 0x02EC0000


// =============== CLASS MEMBERS DECLARATION ===================

.class public sequential ansi sealed beforefieldinit Test.Dummy
       extends [mscorlib]System.ValueType
{
  .pack 0
  .size 1
  .method public hidebysig newslot virtual 
	instance string Virtual() cil managed
  {
    // Code size       11 (0xb)
    .maxstack  1
    .locals init (string V_0)
    IL_0000:  nop
    IL_0001:  ldstr      "Dummy.Virtual"
    IL_0006:  stloc.0
    IL_0007:  br.s       IL_0009

    IL_0009:  ldloc.0
    IL_000a:  ret
  } // end of method Dummy::Virtual

} // end of class Test.Dummy

.class public auto ansi sealed Test.TestMethod
       extends [mscorlib]System.MulticastDelegate
{
  .method public hidebysig specialname rtspecialname 
          instance void  .ctor(object 'object',
                               native int 'method') runtime managed
  {
  } // end of method TestMethod::.ctor

  .method public hidebysig newslot virtual 
          instance string  Invoke() runtime managed
  {
  } // end of method TestMethod::Invoke

  .method public hidebysig newslot virtual 
          instance class [mscorlib]System.IAsyncResult 
          BeginInvoke(class [mscorlib]System.AsyncCallback callback,
                      object 'object') runtime managed
  {
  } // end of method TestMethod::BeginInvoke

  .method public hidebysig newslot virtual 
          instance string  EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
  {
  } // end of method TestMethod::EndInvoke

} // end of class Test.TestMethod

.class public abstract auto ansi sealed beforefieldinit Test.Program
       extends [mscorlib]System.Object
{
  .method public hidebysig static void  CallDummy() cil managed
  {
    // Code size       56 (0x38)
    .maxstack  4
    .locals init (valuetype Test.Dummy V_0)
    IL_0000:  nop
    IL_0001:  ldloca.s   V_0
    IL_0003:  initobj    Test.Dummy
    IL_0009:  ldstr      "Dummy.Virtual"
    IL_000e:  ldloca.s   V_0
    IL_0010:  call       instance string Test.Dummy::Virtual()
    IL_0015:  call       void Test.Assert::AreEqual(string,
                                                    string)
    IL_001a:  nop
    IL_001b:  ldstr      "Dummy.Virtual"
    IL_0020:  ldloc.0
    IL_0021:  box        Test.Dummy
    IL_0026:  ldftn      instance string Test.Dummy::Virtual()
    IL_002c:  newobj     instance void Test.TestMethod::.ctor(object,
                                                              native int)
    IL_0031:  call       void Test.Assert::AreEqual(string,
                                                    class Test.TestMethod)
    IL_0036:  nop
    IL_0037:  ret
  } // end of method Program::CallDummy

  .method public hidebysig static int32  Main(string[] args) cil managed
  {
    .entrypoint
    // Code size       52 (0x34)
    .maxstack  1
    .locals init (class [mscorlib]System.Exception V_0,
             int32 V_1)
    IL_0000:  nop
    .try
    {
      IL_0001:  nop
      IL_0002:  call       void Test.Program::CallDummy()
      IL_0007:  nop
      IL_0008:  ldstr      "Test SUCCESS"
      IL_000d:  call       void [mscorlib]System.Console::WriteLine(string)
      IL_0012:  nop
      IL_0013:  ldc.i4.s   100
      IL_0015:  stloc.1
      IL_0016:  leave.s    IL_0031

    }  // end .try
    catch [mscorlib]System.Exception 
    {
      IL_0018:  stloc.0
      IL_0019:  nop
      IL_001a:  ldloc.0
      IL_001b:  call       void [mscorlib]System.Console::WriteLine(object)
      IL_0020:  nop
      IL_0021:  ldstr      "Test FAILED"
      IL_0026:  call       void [mscorlib]System.Console::WriteLine(string)
      IL_002b:  nop
      IL_002c:  ldc.i4.s   101
      IL_002e:  stloc.1
      IL_002f:  leave.s    IL_0031

    }  // end handler
    IL_0031:  nop
    IL_0032:  ldloc.1
    IL_0033:  ret
  } // end of method Program::Main

} // end of class Test.Program

.class public abstract auto ansi sealed beforefieldinit Test.Assert
       extends [mscorlib]System.Object
{
  .method public hidebysig static void  AreEqual(string left,
                                                 class Test.TestMethod right) cil managed
  {
    // Code size       15 (0xf)
    .maxstack  8
    IL_0000:  nop
    IL_0001:  ldarg.0
    IL_0002:  ldarg.1
    IL_0003:  callvirt   instance string Test.TestMethod::Invoke()
    IL_0008:  call       void Test.Assert::AreEqual(string,
                                                    string)
    IL_000d:  nop
    IL_000e:  ret
  } // end of method Assert::AreEqual

  .method public hidebysig static void  AreEqual(string left,
                                                 string right) cil managed
  {
    // Code size       85 (0x55)
    .maxstack  3
    .locals init (string V_0,
             bool V_1)
    IL_0000:  nop
    IL_0001:  ldarg.0
    IL_0002:  call       bool [mscorlib]System.String::IsNullOrEmpty(string)
    IL_0007:  ldc.i4.0
    IL_0008:  ceq
    IL_000a:  stloc.1
    IL_000b:  ldloc.1
    IL_000c:  brtrue.s   IL_0019

    IL_000e:  ldstr      "left"
    IL_0013:  newobj     instance void [mscorlib]System.ArgumentNullException::.ctor(string)
    IL_0018:  throw

    IL_0019:  ldarg.1
    IL_001a:  call       bool [mscorlib]System.String::IsNullOrEmpty(string)
    IL_001f:  ldc.i4.0
    IL_0020:  ceq
    IL_0022:  stloc.1
    IL_0023:  ldloc.1
    IL_0024:  brtrue.s   IL_0031

    IL_0026:  ldstr      "right"
    IL_002b:  newobj     instance void [mscorlib]System.ArgumentNullException::.ctor(string)
    IL_0030:  throw

    IL_0031:  ldarg.0
    IL_0032:  ldarg.1
    IL_0033:  call       bool [mscorlib]System.String::op_Inequality(string,
                                                                     string)
    IL_0038:  ldc.i4.0
    IL_0039:  ceq
    IL_003b:  stloc.1
    IL_003c:  ldloc.1
    IL_003d:  brtrue.s   IL_0054

    IL_003f:  nop
    IL_0040:  ldstr      "[[{0}]] != [[{1}]]"
    IL_0045:  ldarg.0
    IL_0046:  ldarg.1
    IL_0047:  call       string [mscorlib]System.String::Format(string,
                                                                object,
                                                                object)
    IL_004c:  stloc.0
    IL_004d:  ldloc.0
    IL_004e:  newobj     instance void [mscorlib]System.Exception::.ctor(string)
    IL_0053:  throw

    IL_0054:  ret
  } // end of method Assert::AreEqual

} // end of class Test.Assert


// =============================================================

// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file valuetype.res