Reduce TLS accesses. (#11487)
[mono-project.git] / mono / tests / test-ops.cs
blob809f5d34badbe3efca83edad4fb2138c9ff58272
2 public class TestIntOps {
4 public static sbyte sbyte_add (sbyte a, sbyte b) {
5 return (sbyte)(a+b);
8 public static short short_add (short a, short b) {
9 return (short)(a+b);
12 public static double double_add (double a, double b) {
13 return a+b;
16 public static int int_add (int a, int b) {
17 return a+b;
20 public static int int_sub (int a, int b) {
21 return a-b;
24 public static int int_mul (int a, int b) {
25 return a*b;
28 public static int int_div (int a, int b) {
29 return a/b;
32 public static int Main() {
33 int num = 1;
35 if (int_div (5, 2) != 2) return num;
36 num++;
38 if (int_add (1, 1) != 2) return num;
39 num++;
41 if (int_add (31, -1) != 30) return num;
42 num++;
44 if (int_sub (31, -1) != 32) return num;
45 num++;
47 if (int_mul (12, 12) != 144) return num;
48 num++;
50 if (sbyte_add (1, 1) != 2) return num;
51 num++;
53 if (sbyte_add (31, -1) != 30) return num;
54 num++;
56 if (short_add (1, 1) != 2) return num;
57 num++;
59 if (short_add (31, -1) != 30) return num;
60 num++;
62 if (double_add (1.5, 1.5) != 3) return num;
63 num++;
65 // add more meaningful tests
67 return 0;