[Tailcall] Bring coreclr tests for tail calls to Mono source tree (#7204)
[mono-project.git] / mono / tests / tailcall / coreclr / JIT / Methodical / Boxing / boxunbox / tailcall.il
blobd7e8554e51a9545c6022ce023331496e6128cf28
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 .assembly extern mscorlib { }
6 .assembly 'tailcall' { }
7 .namespace JitTest
9   .class private auto ansi beforefieldinit App
10          extends [mscorlib]System.Object
11   {
12     .method private hidebysig static int64 
13             Test(bool path) cil managed
14     {
15       .maxstack  4
16       .locals (int32 V_0)
17       IL_0000:  ldc.i4.s   100
18       IL_0002:  stloc.0
19       IL_0003:  ldloc.0
20                         ldarg.0
21                         brfalse    IL_000f
22       IL_0004:  box        [mscorlib]System.Int32
23       IL_0009:  unbox      [mscorlib]System.Int32
24       IL_000e:  ldind.i4
25       IL_000f:  conv.r4
26                         ldarg.0
27                         brfalse    IL_01c8
28       IL_0010:  box        [mscorlib]System.Single
29       IL_0015:  unbox      [mscorlib]System.Single
30       IL_001a:  ldind.r4
31       IL_001b:  conv.i1
32       IL_001c:  box        [mscorlib]System.SByte
33                         ldarg.0
34                         brfalse    IL_002c
35       IL_0021:  unbox      [mscorlib]System.SByte
36       IL_0026:  ldind.i1
37       IL_0027:  box        [mscorlib]System.SByte
38       IL_002c:  unbox      [mscorlib]System.SByte
39       IL_0031:  ldind.i1
40       IL_0032:  conv.i4
41       IL_0038:  box        [mscorlib]System.IntPtr
42       IL_003d:  unbox      [mscorlib]System.IntPtr
43                         ldarg.0
44                         brfalse    IL_00e0
45       IL_0042:  ldobj      [mscorlib]System.IntPtr
46       IL_004c:  conv.u1
47       IL_004d:  box        [mscorlib]System.Byte
48       IL_0052:  unbox      [mscorlib]System.Byte
49       IL_0057:  ldind.u1
50       IL_0058:  conv.i1
51       IL_0059:  box        [mscorlib]System.SByte
52       IL_005e:  unbox      [mscorlib]System.SByte
53       IL_0063:  ldind.i1
54       IL_0064:  conv.i8
55       IL_0065:  box        [mscorlib]System.UInt64
56       IL_006a:  unbox      [mscorlib]System.UInt64
57       IL_006f:  ldind.i8
58                         conv.i
59       IL_0075:  box        [mscorlib]System.IntPtr
60       IL_007a:  unbox      [mscorlib]System.IntPtr
61       IL_007f:  ldobj      [mscorlib]System.IntPtr
62       IL_0089:  conv.u8
63                         ldarg.0
64                         brfalse    IL_00c6
65       IL_008a:  box        [mscorlib]System.UInt64
66       IL_008f:  unbox      [mscorlib]System.UInt64
67       IL_0094:  ldind.i8
68       IL_0095:  conv.u1
69       IL_0096:  box        [mscorlib]System.Byte
70       IL_009b:  unbox      [mscorlib]System.Byte
71       IL_00a0:  ldind.u1
72       IL_00a1:  conv.u8
73       IL_00a2:  box        [mscorlib]System.Int64
74       IL_00a7:  unbox      [mscorlib]System.Int64
75       IL_00ac:  ldind.i8
76       IL_00ad:  conv.i1
77       IL_00ae:  box        [mscorlib]System.SByte
78       IL_00b3:  unbox      [mscorlib]System.SByte
79       IL_00b8:  ldind.i1
80       IL_00b9:  conv.u4
81       IL_00ba:  box        [mscorlib]System.UInt32
82       IL_00bf:  unbox      [mscorlib]System.UInt32
83       IL_00c4:  ldind.u4
84       IL_00c5:  conv.u8
85       IL_00c6:  box        [mscorlib]System.Int64
86       IL_00cb:  unbox      [mscorlib]System.Int64
87       IL_00d0:  ldind.i8
88                         conv.u
89       IL_00d6:  box        [mscorlib]System.UIntPtr
90       IL_00db:  unbox      [mscorlib]System.UIntPtr
91       IL_00e0:  ldobj      [mscorlib]System.UIntPtr
92       IL_00ea:  conv.r.un
93       IL_00eb:  conv.r4
94       IL_00ec:  box        [mscorlib]System.Single
95       IL_00f1:  unbox      [mscorlib]System.Single
96       IL_00f6:  ldind.r4
97       IL_00f7:  conv.i1
98       IL_00f8:  box        [mscorlib]System.SByte
99       IL_00fd:  unbox      [mscorlib]System.SByte
100       IL_0102:  ldind.i1
101       IL_0103:  box        [mscorlib]System.SByte
102       IL_0108:  unbox      [mscorlib]System.SByte
103       IL_010d:  ldind.i1
104       IL_010e:  conv.i4
105       IL_0114:  box        [mscorlib]System.IntPtr
106       IL_0119:  unbox      [mscorlib]System.IntPtr
107       IL_011e:  ldobj      [mscorlib]System.IntPtr
108       IL_0128:  conv.u1
109       IL_0129:  box        [mscorlib]System.Byte
110       IL_012e:  unbox      [mscorlib]System.Byte
111       IL_0133:  ldind.u1
112       IL_0134:  conv.i1
113       IL_0135:  box        [mscorlib]System.SByte
114       IL_013a:  unbox      [mscorlib]System.SByte
115       IL_013f:  ldind.i1
116       IL_0140:  conv.i8
117       IL_0141:  box        [mscorlib]System.UInt64
118       IL_0146:  unbox      [mscorlib]System.UInt64
119       IL_014b:  ldind.i8
120                         conv.i
121       IL_0151:  box        [mscorlib]System.IntPtr
122       IL_0156:  unbox      [mscorlib]System.IntPtr
123       IL_015b:  ldobj      [mscorlib]System.IntPtr
124       IL_0165:  conv.u8
125       IL_0166:  box        [mscorlib]System.UInt64
126       IL_016b:  unbox      [mscorlib]System.UInt64
127       IL_0170:  ldind.i8
128       IL_0171:  conv.u1
129                         ldarg.0
130                         brfalse    IL_018a
131       IL_0172:  box        [mscorlib]System.Byte
132       IL_0177:  unbox      [mscorlib]System.Byte
133       IL_017c:  ldind.u1
134       IL_017d:  conv.u8
135       IL_017e:  box        [mscorlib]System.Int64
136       IL_0183:  unbox      [mscorlib]System.Int64
137       IL_0188:  ldind.i8
138       IL_0189:  conv.i1
139       IL_018a:  box        [mscorlib]System.SByte
140       IL_018f:  unbox      [mscorlib]System.SByte
141       IL_0194:  ldind.i1
142       IL_0195:  conv.u4
143       IL_0196:  box        [mscorlib]System.UInt32
144       IL_019b:  unbox      [mscorlib]System.UInt32
145       IL_01a0:  ldind.u4
146       IL_01a1:  conv.u8
147       IL_01a2:  box        [mscorlib]System.Int64
148       IL_01a7:  unbox      [mscorlib]System.Int64
149       IL_01ac:  ldind.i8
150                         conv.u
151       IL_01b2:  box        [mscorlib]System.UIntPtr
152       IL_01b7:  unbox      [mscorlib]System.UIntPtr
153       IL_01bc:  ldobj      [mscorlib]System.UIntPtr
154       IL_01c6:  conv.r.un
155       IL_01c7:  conv.r8
156       IL_01c8:  box        [mscorlib]System.Double
157       IL_01cd:  unbox      [mscorlib]System.Double
158       IL_01d2:  ldind.r8
159       IL_01d3:  ldc.r8     100.
160       IL_01dc:  beq.s      IL_END
162       IL_01de:  ldstr      "Loss of precision or unbox error"
163       IL_01e3:  newobj     instance void [mscorlib]System.Exception::.ctor(string)
164       IL_01e8:  throw
166                 IL_END:
167                                 ldc.i8 100
168                                 ldarg.0
169                                 brfalse.s IL_RET
170                                 pop
171                                 ldc.i4.0
172                 tail.   call       int64 JitTest.App::Test(bool)
173       IL_RET:  ret
174     } // end of method App::Test
176     .method private hidebysig static int32 
177             Main() cil managed
178     {
179       .entrypoint
180       .maxstack  4
181       .locals (int32 V_0)
182       IL_0000:  ldc.i4.0
183       IL_0001:  call       int64 JitTest.App::Test(bool)
184       IL_0006:  ldc.i4.1
185       IL_0007:  call       int64 JitTest.App::Test(bool)
186                         pop
187                         pop
188       IL_000c:  ldstr      "=== TEST PASSED ==="
189       IL_0011:  call       void [mscorlib]System.Console::WriteLine(string)
190       IL_0016:  ldc.i4.s   100
191       IL_0018:  stloc.0
192       IL_0019:  br.s       IL_001b
194       IL_001b:  ldloc.0
195       IL_001c:  ret
196     } // end of method App::Main
198     .method public hidebysig specialname rtspecialname 
199             instance void  .ctor() cil managed
200     {
201       .maxstack  8
202       IL_0000:  ldarg.0
203       IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
204       IL_0006:  ret
205     } // end of method App::.ctor
207   } // end of class App
209 } // end of namespace JitTest