Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / jit-uint.cs
1 public class TestJit {
2
3         public static uint test_call (uint a, uint b) {
4                 return a+b;
5         }
6
7         public static int test_alu ()
8         {
9                 uint a = 9, b = 6;
10                 
11                 if ((a + b) != 15)
12                         return 1;
13                 
14                 if ((a - b) != 3)
15                         return 1;
16
17                 if ((a & 8) != 8)
18                         return 1;
19
20                 if ((a | 2) != 11)
21                         return 1;
22
23                 if ((a * b) != 54)
24                         return 1;
25                 
26                 if ((a / 4) != 2)
27                         return 1;
28                 
29                 if ((a % 4) != 1)
30                         return 1;
31
32                 b = 0;
33                 if (~b != 0xffffffff)
34                         return 1;
35                 
36                 return 0;
37         }
38         
39         public static int test_branch ()
40         {
41                 uint a = 5, b = 5, t;
42                 
43                 if (a == b) t = 1; else t = 0;
44                 if (t != 1) return 1;
45
46                 if (a != b) t = 0; else t = 1;
47                 if (t != 1) return 1;
48
49                 if (a >= b) t = 1; else t = 0;
50                 if (t != 1) return 1;
51
52                 if (a > b) t = 0; else t = 1;
53                 if (t != 1) return 1;
54
55                 if (a <= b) t = 1; else t = 0;
56                 if (t != 1) return 1;
57
58                 if (a < b) t = 0; else t = 1;
59                 if (t != 1) return 1;
60
61                 return 0;
62         }
63
64         public static int Main() {
65                 int num = 1;
66
67                 if (test_call (3, 5) != 8)
68                         return num;
69                 num++;
70                 
71                 if (test_branch () != 0)
72                         return num;
73                 num++;
74                 
75                 if (test_alu () != 0)
76                         return num;
77                 num++;
78         
79                 return 0;
80         }
81 }
82