Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / benchmark / inline4.cs
1 using System;
2
3 public class Tests {
4
5         public static int test (int n) {
6                 if ((n & 1) == 0)
7                         return 2;
8                 else
9                         return 1;
10         }
11
12         public static int Main (string[] args) {
13                 int repeat = 1;
14                 int sum = 0;
15                 
16                 if (args.Length == 1)
17                         repeat = Convert.ToInt32 (args [0]);
18                 
19                 Console.WriteLine ("Repeat = " + repeat);
20
21                 for (int i = 0; i < repeat; i++)
22                         for (int j = 0; j < 50000000; j++)
23                                 sum += test (j);
24
25                 
26                 Console.WriteLine (sum);
27                 if (sum != (75000000 * repeat))
28                         return 1;
29                 
30                 return 0;
31         }
32 }
33
34