2008-07-07 Bill Holmes <billholmes54@gmail.com>
[mono.git] / mono / mini / basic-calls.cs
index 863b6eb0274bcf95bf9eb4b91bd3809724099327..77996ab2ee3d5f7ca499f34f9b67a427594ad5f1 100644 (file)
@@ -154,6 +154,17 @@ class Tests {
                return (int)pass_floats (1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        }
 
+       public static bool is_small (float value) {
+               double d = (double)value;
+               double d2 = 7.183757E-41;
+               return d - d2 < 0.000001;
+       }
+               
+       static int test_0_float_argument_passing_precision () {
+               float f = 7.183757E-41f;
+               return is_small (f) ? 0 : 1;
+       }
+
        // The first argument must be passed on a dword aligned stack location
        static int pass_byref_ints_longs (ref long a, ref int b, ref byte c, ref short d, ref long e, ref int f, ref long g) {
                return (int)(a + b + c + d + e + f + g);
@@ -265,54 +276,6 @@ class Tests {
                return 0;
        }
 
-       struct struct1 {
-               public int      a;
-               public int      b;
-       };
-
-       static int check_struct1(struct1 x) {
-               if (x.a != 1)
-                       return 1;
-               if (x.b != 2)
-                       return 2;
-               return 0;
-       }
-
-       static int pass_struct1(int a, int b, struct1 x) {
-               if (a != 3)
-                       return 3;
-               if (b != 4)
-                       return 4;
-               return check_struct1(x);
-       }
-
-       static int pass_struct1(int a, struct1 x) {
-               if (a != 3)
-                       return 3;
-               return check_struct1(x);
-       }
-
-       static int pass_struct1(struct1 x) {
-               return check_struct1(x);
-       }
-
-       static int test_0_struct1_args () {
-               int r;
-               struct1 x;
-
-               x.a = 1;
-               x.b = 2;
-               if ((r = check_struct1(x)) != 0)
-                       return r;
-               if ((r = pass_struct1(x)) != 0)
-                       return r + 10;
-               if ((r = pass_struct1(3, x)) != 0)
-                       return r + 20;
-               if ((r = pass_struct1(3, 4, x)) != 0)
-                       return r + 30;
-               return 0;
-       }
-
        static void doit (double value, out long m) {
                m = (long) value;
        }