Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / basic-calls.cs
index 2fd603db91060e93be0b14a65d7ba95bf3544c07..ad3cdde59a1f3284f151948cf5441b6910db2fd8 100644 (file)
@@ -23,11 +23,18 @@ using System.Reflection;
  * the IL code looks.
  */
 
-class Tests {
+#if __MOBILE__
+class CallsTests
+#else
+class Tests
+#endif
+{
 
-       static int Main () {
-               return TestDriver.RunTests (typeof (Tests));
+#if !__MOBILE__
+       public static int Main (string[] args) {
+               return TestDriver.RunTests (typeof (Tests), args);
        }
+#endif
 
        static void dummy () {
        }
@@ -122,12 +129,12 @@ class Tests {
                return pass_bytes (0, 1, 2, 3, 4, 5, 6);
        }
 
-       static int pass_sbytes (sbyte a, sbyte b, sbyte c, sbyte d, sbyte e, sbyte f, sbyte g) {
-               return (int)(a + b + c + d + e + f + g);
+       static int pass_sbytes (sbyte a, sbyte b, sbyte c, sbyte d, sbyte e, sbyte f, sbyte g, sbyte h1, sbyte h2, sbyte h3, sbyte h4) {
+               return (int)(a + b + c + d + e + f + g + h1 + h2 + h3 + h4);
        }
 
-       public static int test_21_sparc_sbyte_argument_passing () {
-               return pass_sbytes (0, 1, 2, 3, 4, 5, 6);
+       public static int test_55_sparc_sbyte_argument_passing () {
+               return pass_sbytes (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        }
 
        static int pass_shorts (short a, short b, short c, short d, short e, short f, short g) {
@@ -276,6 +283,29 @@ class Tests {
                return 0;
        }
 
+       public static void use_long_arg (ulong l) {
+               for (int i = 0; i < 10; ++i)
+                       l ++;
+       }
+
+       public static ulong return_long_arg (object o, ulong perm) {
+               use_long_arg (perm);
+
+        perm = 0x8000000000000FFF;
+
+               use_long_arg (perm);
+
+               return perm;
+       }
+
+    public static int test_0_sparc_long_ret_regress_541577 () {
+        ulong perm = 0x8000000000000FFF;
+
+        ulong work = return_long_arg (null, perm);
+
+               return work == perm ? 0 : 1;
+       }
+
        static void doit (double value, out long m) {
                m = (long) value;
        }
@@ -287,5 +317,29 @@ class Tests {
                        return 2;
                return 0;
        }
-}
 
+       public static bool arm64_stack_arg_reg_bool (object o1, object o2, object o3, object o4, object o5, object o6, object o7,
+                                                                                                bool foo, bool bar) {
+               bool res1 = bar || foo;
+               bool res2 = bar || foo;
+               return res1 | res2;
+       }
+
+       public static int arm64_stack_arg_reg_sbyte (object o1, object o2, object o3, object o4, object o5, object o6, object o7,
+                                                                                                sbyte foo, sbyte bar) {
+               int res1 = bar + foo;
+               int res2 = bar + foo;
+               return res1 + res2;
+       }
+
+       // bool argument passed on the stack and promoted to a register
+       public static int test_0_arm64_stack_arg_reg_bool () {
+           bool res = arm64_stack_arg_reg_bool (null, null, null, null, null, null, null, false, false);
+               return res ? 1 : 0;
+       }
+
+       public static int test_0_arm64_stack_arg_reg_sbyte () {
+           int res = arm64_stack_arg_reg_sbyte (null, null, null, null, null, null, null, -4, -7);
+               return res == -22 ? 0 : 1;
+       }
+}