summaryrefslogtreecommitdiff
path: root/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAA.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAA.cs')
-rw-r--r--tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAA.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAA.cs b/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAA.cs
new file mode 100644
index 0000000000..e36d28ac6a
--- /dev/null
+++ b/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAA.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+
+namespace CGRecurse
+{
+ public class RecursiveAAA
+ {
+ public static string ActualResult;
+
+ public static int cntA = 0;
+
+ public static int cntB = 0;
+
+ public static int cntC = 0;
+
+ public static int Main()
+ {
+ string ExpectedResult = "AAA";
+ int retVal = 1;
+ A();
+ if (ExpectedResult.Equals(ActualResult))
+ {
+ Console.WriteLine("Test SUCCESS");
+ retVal = 100;
+ }
+ return retVal;
+ }
+
+ public static void A()
+ {
+ ActualResult = (ActualResult + "A");
+ if ((cntA == 1))
+ {
+ cntA = 0;
+ return;
+ }
+ cntA = (cntA + 1);
+ A();
+ if ((cntA == 1))
+ {
+ cntA = 0;
+ return;
+ }
+ cntA = (cntA + 1);
+ A();
+ return;
+ }
+ }
+}