Don't run test-318 with gmcs.
[mono.git] / mono / mini / basic-float.cs
index 46fa8e42d67bdeda7d316ef6474019131f788c8d..b2aff5dad302781c267df93d48bdcfa40f8feb18 100644 (file)
@@ -50,14 +50,50 @@ class Tests {
                return 0;
        }
 
-       static int test_0_conv_i4 () {
+       static int test_0_conv_i () {
                double a = 2.0;
-               int b = (int)a;
-               if (b != 2)
+               int i = (int)a;
+               if (i != 2)
                        return 1;
+               uint ui = (uint)a;
+               if (ui != 2)
+                       return 2;
+               short s = (short)a;
+               if (s != 2)
+                       return 3;
+               ushort us = (ushort)a;
+               if (us != 2)
+                       return 4;
+               byte b = (byte)a;
+               if (b != 2)
+                       return 5;
                return 0;
        }
 
+       static int test_5_conv_r4 () {
+               int i = 5;
+               float f = (float)i;
+               return (int)f;
+       }
+
+       static int test_5_double_conv_r4 () {
+               double d = 5.0;
+               float f = (float)d;
+               return (int)f;
+       }
+
+       static int test_5_float_conv_r8 () {
+               float f = 5.0F;
+               double d = (double)f;
+               return (int)d;
+       }
+
+       static int test_5_conv_r8 () {
+               int i = 5;
+               double f = (double)i;
+               return (int)f;
+       }
+
        static int test_5_add () {
                double a = 2.0;
                double b = 3.0;         
@@ -93,7 +129,7 @@ class Tests {
                return (int)(-a);
        }
        
-       static int test_46_float_spill () {
+       static int test_46_float_add_spill () {
                // we overflow the FP stack
                double a = 1;
                double b = 2;
@@ -108,6 +144,37 @@ class Tests {
                return (int)(1.0 + (a + (b + (c + (d + (e + (f + (g + (h + i)))))))));
        }
 
+       static int test_4_float_sub_spill () {
+               // we overflow the FP stack
+               double a = 1;
+               double b = 2;
+               double c = 3;
+               double d = 4;
+               double e = 5;
+               double f = 6;
+               double g = 7;
+               double h = 8;
+               double i = 9;
+
+               return -(int)(1.0 - (a - (b - (c - (d - (e - (f - (g - (h - i)))))))));
+               ////// -(int)(1.0 - (1 - (2 - (3 - (4 - (5 - (6 - (7 - (8 - 9)))))))));
+       }
+
+       static int test_362880_float_mul_spill () {
+               // we overflow the FP stack
+               double a = 1;
+               double b = 2;
+               double c = 3;
+               double d = 4;
+               double e = 5;
+               double f = 6;
+               double g = 7;
+               double h = 8;
+               double i = 9;
+
+               return (int)(1.0 * (a * (b * (c * (d * (e * (f * (g * (h * i)))))))));
+       }
+
        static int test_4_long_cast () {
                long a = 1000;
                double d = (double)a;
@@ -117,6 +184,8 @@ class Tests {
                return 4;
        }
 
+       /* FIXME: This only works on little-endian machines */
+       /*
        static unsafe int test_2_negative_zero () {
                int result = 0;
                double d = -0.0;
@@ -134,8 +203,9 @@ class Tests {
 
                return result;
        }
+       */
 
-       static int test_15_float_cmp () {
+       static int test_16_float_cmp () {
                double a = 2.0;
                double b = 1.0;
                int result = 0;
@@ -146,6 +216,11 @@ class Tests {
                        return result;
                result++;
 
+               val = (a != a);
+               if (val)
+                       return result;
+               result++;
+
                val = a < a;
                if (val)
                        return result;