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

.assembly extern mscorlib { }
.assembly extern System.Console
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
  .ver 4:0:0:0
}
.assembly test_mutual_rec { }
.namespace JitTest
{
  .class private auto ansi beforefieldinit Test
         extends [mscorlib]System.Object
  {
    .field private static int32 m
    .field private static int32 n
	.method private hidebysig  static int32 Main() il managed
    {
      .entrypoint
      .maxstack  4
      .locals (int32 V_0)
      ldc.i4.1
      call       void [mscorlib]System.Environment::set_ExitCode(int32)
      ldsfld     int32 JitTest.Test::n
      ldc.i4.1
      bne.un.s   IL_0047

      ldsfld     int32 JitTest.Test::m
      ldc.i4     0x375f00
      bne.un.s   IL_0029

      ldstr      "PASSED: 10! == 3628800"
      call       void [System.Console]System.Console::WriteLine(class System.String)
      ldc.i4.s   100
      ret

IL_0029:
      ldstr      "FAILED: 10! != "
      ldsflda    int32 JitTest.Test::m
      call       instance class System.String [mscorlib]System.Int32::ToString()
      call       class System.String [mscorlib]System.String::Concat(class System.String,
                                                                               class System.String)
      call       void [System.Console]System.Console::WriteLine(class System.String)
      ldc.i4.s   101
      ret

IL_0047:
      ldsfld     int32 JitTest.Test::m
      ldsfld     int32 JitTest.Test::n
      dup
      ldc.i4.1
      sub
      stsfld     int32 JitTest.Test::n
      mul
      stsfld     int32 JitTest.Test::m
      
      ldsfld int32 JitTest.Test::n
      ldc.i4.3
      rem
      switch (CASE1, CASE2)
      ldftn int32 JitTest.Test::Main()
      br.s MERGE1
CASE1:
      ldftn int32 JitTest.Test::Main1()
      br.s MERGE1
CASE2:
      ldftn int32 JitTest.Test::Main2()
MERGE1:
      tail. calli int32()
      ret
    } // end of method Test::Main
	.method private hidebysig  static int32 Main1() il managed
    {
      .maxstack  4
      .locals (int32 V_0)
      ldc.i4.1
      call       void [mscorlib]System.Environment::set_ExitCode(int32)
      ldsfld     int32 JitTest.Test::n
      ldc.i4.1
      bne.un.s   IL_0047

      ldsfld     int32 JitTest.Test::m
      ldc.i4     0x375f00
      bne.un.s   IL_0029

      ldstr      "PASSED: 10! == 3628800"
      call       void [System.Console]System.Console::WriteLine(class System.String)
      ldc.i4.s   100
      ret

IL_0029:
      ldstr      "FAILED: 10! != "
      ldsflda    int32 JitTest.Test::m
      call       instance class System.String [mscorlib]System.Int32::ToString()
      call       class System.String [mscorlib]System.String::Concat(class System.String,
                                                                               class System.String)
      call       void [System.Console]System.Console::WriteLine(class System.String)
      ldc.i4.s   101
      ret

IL_0047:
      ldsfld     int32 JitTest.Test::m
      ldsfld     int32 JitTest.Test::n
      dup
      ldc.i4.1
      sub
      stsfld     int32 JitTest.Test::n
      mul
      stsfld     int32 JitTest.Test::m
      
      ldsfld int32 JitTest.Test::n
      ldc.i4.3
      rem
      switch (CASE1, CASE2)
      ldftn int32 JitTest.Test::Main()
      br.s MERGE1
CASE1:
      ldftn int32 JitTest.Test::Main1()
      br.s MERGE1
CASE2:
      ldftn int32 JitTest.Test::Main2()
MERGE1:
      tail. calli int32()
      ret
    } // end of method Test::Main
	.method private hidebysig  static int32 Main2() il managed
    {
      .maxstack  4
      .locals (int32 V_0)
      ldc.i4.1
      call       void [mscorlib]System.Environment::set_ExitCode(int32)
      ldsfld     int32 JitTest.Test::n
      ldc.i4.1
      bne.un.s   IL_0047

      ldsfld     int32 JitTest.Test::m
      ldc.i4     0x375f00
      bne.un.s   IL_0029

      ldstr      "PASSED: 10! == 3628800"
      call       void [System.Console]System.Console::WriteLine(class System.String)
      ldc.i4.s   100
      ret

IL_0029:
      ldstr      "FAILED: 10! != "
      ldsflda    int32 JitTest.Test::m
      call       instance class System.String [mscorlib]System.Int32::ToString()
      call       class System.String [mscorlib]System.String::Concat(class System.String,
                                                                               class System.String)
      call       void [System.Console]System.Console::WriteLine(class System.String)
      ldc.i4.s   101
      ret

IL_0047:
      ldsfld     int32 JitTest.Test::m
      ldsfld     int32 JitTest.Test::n
      dup
      ldc.i4.1
      sub
      stsfld     int32 JitTest.Test::n
      mul
      stsfld     int32 JitTest.Test::m
      
      ldsfld int32 JitTest.Test::n
      ldc.i4.3
      rem
      switch (CASE1, CASE2)
      ldftn int32 JitTest.Test::Main()
      br.s MERGE1
CASE1:
      ldftn int32 JitTest.Test::Main1()
      br.s MERGE1
CASE2:
      ldftn int32 JitTest.Test::Main2()
MERGE1:
      tail. calli int32()
      ret
    } // end of method Test::Main

    .method private hidebysig  specialname rtspecialname static 
            void .cctor() il managed
    {
      // Code size       14 (0xe)
      .maxstack  8
      IL_0000:  ldc.i4.1
      IL_0001:  stsfld     int32 JitTest.Test::m
      IL_0006:  ldc.i4.s   10
      IL_0008:  stsfld     int32 JitTest.Test::n
      IL_000d:  ret
    } // end of method Test::.cctor

    .method public hidebysig  specialname rtspecialname 
            instance void .ctor() il managed
    {
      // Code size       7 (0x7)
      .maxstack  8
      IL_0000:  ldarg.0
      IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
      IL_0006:  ret
    } // end of method Test::.ctor

  } // end of class Test

} // end of namespace JitTest

//*********** DISASSEMBLY COMPLETE ***********************