2004-02-19 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Thu, 19 Feb 2004 14:24:18 +0000 (14:24 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 19 Feb 2004 14:24:18 +0000 (14:24 -0000)
* basic-calls.cs basic-float.cs basic-long.cs objects.cs: New regression tests.

svn path=/trunk/mono/; revision=23249

mono/mini/ChangeLog
mono/mini/basic-calls.cs
mono/mini/basic-float.cs
mono/mini/basic-long.cs
mono/mini/objects.cs

index 518a01953d5cfcef4e311bec6e55a22cc0a4b1fb..069541b7699b3f66255ce0853387403ded42063d 100644 (file)
@@ -1,3 +1,6 @@
+2004-02-19  Zoltan Varga  <vargaz@freemail.hu>
+
+       * basic-calls.cs basic-float.cs basic-long.cs objects.cs: New regression tests.
 
 Tue Feb 17 21:41:20 CET 2004 Paolo Molaro <lupus@ximian.com>
 
index 500fdccb36e89d1b243237f7f9e34240a3224a29..233292b963a4fd8d964ae64a8fc18d360e36ea05 100644 (file)
@@ -86,7 +86,6 @@ class Tests {
                return GetFloat (f) == f? 2: 1;
        }
 
-
        static int pass_many_types (int a, long b, int c, long d) {
                return a + (int)b + c + (int)d;
        }
@@ -102,5 +101,50 @@ class Tests {
        static int test_55_pass_even_more () {
                return overflow_registers (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        }
+
+       static int pass_ints_longs (int a, long b, long c, long d, long e, int f, long g) {
+               return (int)(a + b + c + d + e + f + g);
+       }
+
+       static int test_1_sparc_argument_passing () {
+               // The 4. argument tests split reg/mem argument passing
+               // The 5. argument tests mem argument passing
+               // The 7. argument tests passing longs in misaligned memory
+               // The MaxValues are needed so the MS word of the long is not 0
+               return pass_ints_longs (1, 2, System.Int64.MaxValue, System.Int64.MinValue, System.Int64.MaxValue, 0, System.Int64.MinValue);
+       }
+
+       static int pass_bytes (byte a, byte b, byte c, byte d, byte e, byte f, byte g) {
+               return (int)(a + b + c + d + e + f + g);
+       }
+
+       static int test_21_sparc_byte_argument_passing () {
+               return pass_bytes (0, 1, 2, 3, 4, 5, 6);
+       }
+
+       static int pass_shorts (short a, short b, short c, short d, short e, short f, short g) {
+               return (int)(a + b + c + d + e + f + g);
+       }
+
+       static int test_21_sparc_short_argument_passing () {
+               return pass_shorts (0, 1, 2, 3, 4, 5, 6);
+       }
+
+       static int pass_floats_doubles (float a, double b, double c, double d, double e, float f, double g) {
+               return (int)(a + b + c + d + e + f + g);
+       }
+
+       static int test_721_sparc_float_argument_passing () {
+               return pass_floats_doubles (100.0f, 101.0, 102.0, 103.0, 104.0, 105.0f, 106.0);
+       }
+
+       static bool isnan (float f) {
+               return (f != f);
+       }
+
+       static int test_0_isnan () {
+               float f = 1.0f;
+               return isnan (f) ? 1 : 0;
+       }
 }
 
index d94331d6df57b9e03229c271b53c0b43c3aeef51..3a5661b02847e3445051dbd6fb6ad0a082d69f3f 100644 (file)
@@ -58,6 +58,12 @@ class Tests {
                return 0;
        }
 
+       static int test_5_conv_r4 () {
+               int i = 5;
+               float f = (float)i;
+               return (int)f;
+       }
+
        static int test_5_add () {
                double a = 2.0;
                double b = 3.0;         
@@ -132,6 +138,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;
@@ -149,8 +157,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;
@@ -161,6 +170,11 @@ class Tests {
                        return result;
                result++;
 
+               val = (a != a);
+               if (val)
+                       return result;
+               result++;
+
                val = a < a;
                if (val)
                        return result;
index dbade3f8bc1b1c8f6503ce05bd5e0e5255e68453..c90645ef7e9901293d43470132a3feaebfa53b98 100644 (file)
@@ -647,14 +647,6 @@ class Tests {
                m = (long) value;
        }
        
-       static int test_0_ftol_clobber () {
-               long m;
-               doit (1.3, out m);
-               if (m != 1)
-                       return 2;
-               return 0;
-       }
-
        static int test_3_checked_cast_un () {
                 ulong i = 2;
                 long j;
@@ -685,5 +677,13 @@ class Tests {
                }
                return j;
        }
+
+       static int test_0_ftol_clobber () {
+               long m;
+               doit (1.3, out m);
+               if (m != 1)
+                       return 2;
+               return 0;
+       }
 }
 
index f639b0a319b27c99795ed77e323596456d201b12..7d1a9df985ebb5d5507df7982ac70220157db6d7 100644 (file)
@@ -169,6 +169,25 @@ class Tests {
                return 5;
        }
 
+       struct AStruct {
+               public int i;
+
+               public AStruct (int i) {
+                       this.i = i;
+               }
+
+               public override int GetHashCode () {
+                       return i;
+               }
+       }
+
+       // Test that vtypes are unboxed during a virtual call
+       static int test_44_unbox_trampoline () {
+               AStruct s = new AStruct (44);
+               object o = s;
+               return o.GetHashCode ();
+       }
+
        class TestRegA {
 
                long buf_start;