Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mono/tests/fib.cs')
-rwxr-xr-xmono/tests/fib.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/mono/tests/fib.cs b/mono/tests/fib.cs
index 3a3dff99744..212889482a0 100755
--- a/mono/tests/fib.cs
+++ b/mono/tests/fib.cs
@@ -1,3 +1,5 @@
+using System;
+
public class Fib {
public static int fib (int n) {
@@ -5,9 +7,18 @@ public class Fib {
return 1;
return fib(n-2)+fib(n-1);
}
- public static int Main () {
- if (fib (32) != 3524578)
- return 1;
+ public static int Main (string[] args) {
+ int repeat = 1;
+
+ if (args.Length == 1)
+ repeat = Convert.ToInt32 (args [0]);
+
+ Console.WriteLine ("Repeat = " + repeat);
+
+ for (int i = 0; i < repeat; i++)
+ if (fib (32) != 3524578)
+ return 1;
+
return 0;
}
}