[Tailcall] Bring coreclr tests for tail calls to Mono source tree (#7204)
[mono-project.git] / mono / tests / tailcall / coreclr / JIT / Methodical / Invoke / fptr / recurse_tail_calli.il
blobf8eb7c5753ea89e813a38d75e268dde1ecf9cba9
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 { }
7 .assembly 'recurse'// as "recurse"
10   //  .custom instance void ['mscorlib']System.Diagnostics.DebuggableAttribute::.ctor(bool,
11   //                                                                                  bool) = ( 01 00 00 01 00 00 ) 
12   
13   
15 .module 'recurse.exe'
17 .namespace TestCase
19   .class private auto ansi Test extends ['mscorlib']System.Object
20   {
21     .method private hidebysig static int32 
22             Fact1(int32& arg,
23                   int32& result) il managed
24     {
25       // Code size       38 (0x26)
26       .maxstack  3
27       IL_0000:  ldarg.0
28       IL_0001:  ldind.i4
29       IL_0002:  ldc.i4.1
30       IL_0003:  bgt.s      IL_0005
31       
32                         ldc.i4     0x12345
33                         br        end_of_method
34       
35       IL_0005:  ldarg.1
36       IL_0006:  dup
37       IL_0007:  ldind.i4
38       IL_0008:  ldarg.0
39       IL_0009:  ldind.i4
40       IL_000a:  mul
41       IL_000b:  stind.i4
42       IL_000c:  ldarg.0
43       IL_000d:  dup
44       IL_000e:  ldind.i4
45       IL_000f:  ldc.i4.1
46       IL_0010:  sub
47       IL_0011:  stind.i4
48                         
49                         ldarg.0
50                         ldarg.1
51                         ldftn      int32 TestCase.Test::Fact1(int32&, int32&)
52                         tail. calli      int32 (int32&, int32&)
53                         
54       end_of_method:
55                         ret
57     } // end of method 'Test::Fact1'
59     .method private hidebysig static int32
60             Main() il managed
61     {
62       .entrypoint
63       // Code size       72 (0x48)
64       .maxstack  2
65       .locals (int32 V_0,
66                int32 V_1,
67                int32 V_2)
68       IL_0000:  ldc.i4.6
69       IL_0001:  stloc.0
70       IL_0002:  ldc.i4.1
71       IL_0003:  stloc.1
72       IL_0004:  ldloca.s   V_0
73       IL_0006:  ldloca.s   V_1
74       IL_0008:  call       int32 TestCase.Test::Fact1(int32&,
75                                                       int32&)
76       IL_000d:  ldc.i4     0x12345
77       IL_0012:  beq.s      IL_0022
79       IL_0014:  ldstr      "FAILED"
80       IL_0019:  call       void [mscorlib]System.Console::WriteLine(class System.String)
81       IL_001e:  ldc.i4.1
82       IL_001f:  stloc.2
83       IL_0020:  br.s       IL_0046
85       IL_0022:  ldloc.1
86       IL_0023:  ldc.i4     0x2d0
87       IL_0028:  beq.s      IL_0038
89       IL_002a:  ldstr      "FAILED"
90       IL_002f:  call       void [mscorlib]System.Console::WriteLine(class System.String)
91       IL_0034:  ldc.i4.2
92       IL_0035:  stloc.2
93       IL_0036:  br.s       IL_0046
95       IL_0038:  ldstr      "PASSED"
96       IL_003d:  call       void [mscorlib]System.Console::WriteLine(class System.String)
97       IL_0042:  ldc.i4    0x64
98       IL_0043:  stloc.2
99       IL_0044:  br.s       IL_0046
101       IL_0046:  ldloc.2
102       IL_0047:  ret
103       IL_0048:  
104     } // end of method 'Test::Main'
106     .method public hidebysig specialname rtspecialname 
107             instance void .ctor() il managed
108     {
109       // Code size       7 (0x7)
110       .maxstack  8
111       IL_0000:  ldarg.0
112       IL_0001:  call       instance void ['mscorlib']System.Object::.ctor()
113       IL_0006:  ret
114       IL_0007:  
115     } // end of method 'Test::.ctor'
117   } // end of class 'Test'
119 } // end of namespace 'TestCase'