[arm64] Add the full neon regs to the context
[mono.git] / mono / mini / basic-calls.cs
index 01be6a523f803d26b1fa238fb2f9625fb58964bc..ad3cdde59a1f3284f151948cf5441b6910db2fd8 100644 (file)
@@ -23,23 +23,18 @@ using System.Reflection;
  * the IL code looks.
  */
 
-struct Alpha {
-       public long a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;
-}
-
-struct Beta {
-       public Alpha a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;
-}
+#if __MOBILE__
+class CallsTests
+#else
+class Tests
+#endif
+{
 
-struct Gamma {
-       public Beta a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;
-}
-
-class Tests {
-
-       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 () {
        }
@@ -134,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) {
@@ -288,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;
        }
@@ -300,45 +318,28 @@ class Tests {
                return 0;
        }
 
-       static void InitMe (out Gamma noMercyWithTheStack) {
-               noMercyWithTheStack = new Gamma ();
+       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;
        }
 
-       static int FunNoInline () {
-               int x = 99;
-               if (x > 344 && x < 22)
-                       return 333;
-               return x;
+       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;
        }
 
-       static float DoNothingButDontInline (float a, int b) {
-               if (b > 0)
-                       return a;
-               else if (b < 0 && b > 10)
-                       return 444.0f;
-               return a;
+       // 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;
        }
 
-       /*
-        * The local register allocator emits loadr8_membase and storer8_membase
-        * to do spilling. This code is generated after mono_arch_lowering_pass so
-        * mono_arch_output_basic_block must know how to deal with big offsets.
-        * This only happens because the call in middle forces the temp for "(float)obj"
-        * to be spilled.
-       */
-       public static int test_0_float_load_and_store_with_big_offset ()
-       {
-               object obj = 1.0f;
-               Gamma noMercyWithTheStack;
-               float res;
-
-               InitMe (out noMercyWithTheStack);
-
-               res = DoNothingButDontInline ((float)obj, FunNoInline ());
-
-               if (!(res == 1.0f))
-                       return 1;
-               return 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;
        }
 }
-