Merge pull request #4178 from ntherning/fix-broken-windows-build
[mono-project.git] / mono / tests / jit-ulong.cs
blob9254919faaf5ed5c96fd6cb21c42b1298ac24c11
1 public class TestJit {
3 public static ulong test_call (ulong a, ulong b) {
4 return a+b;
7 public static int test_alu ()
9 ulong a = 9, b = 6;
11 if ((a + b) != 15)
12 return 1;
14 if ((a - b) != 3)
15 return 1;
17 if ((a & 8) != 8)
18 return 1;
20 if ((a | 2) != 11)
21 return 1;
23 if ((a * b) != 54)
24 return 1;
26 if ((a / 4) != 2)
27 return 1;
29 if ((a % 4) != 1)
30 return 1;
32 b = 0;
33 if (~b != 0xffffffffffffffff)
34 return 1;
36 return 0;
39 public static int test_branch ()
41 ulong a = 5, b = 5, t;
43 if (a == b) t = 1; else t = 0;
44 if (t != 1) return 1;
46 if (a != b) t = 0; else t = 1;
47 if (t != 1) return 1;
49 if (a >= b) t = 1; else t = 0;
50 if (t != 1) return 1;
52 if (a > b) t = 0; else t = 1;
53 if (t != 1) return 1;
55 if (a <= b) t = 1; else t = 0;
56 if (t != 1) return 1;
58 if (a < b) t = 0; else t = 1;
59 if (t != 1) return 1;
61 return 0;
64 public static int Main() {
65 int num = 1;
67 if (test_call (3, 5) != 8)
68 return num;
69 num++;
71 if (test_branch () != 0)
72 return num;
73 num++;
75 if (test_alu () != 0)
76 return num;
77 num++;
79 return 0;