2008-08-19 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / basic-float.cs
index fb731f687789ef1547c1504cd5221dba3eab6fde..5962b79b844ccb819b61becd7d5cacfc663367fb 100644 (file)
@@ -192,6 +192,15 @@ class Tests {
                return 4;
        }
 
+       static int test_4_ulong_cast () {
+               ulong a = 1000;
+               double d = (double)a;
+               ulong b = (ulong)d;
+               if (b != 1000)
+                       return 0;
+               return 4;
+       }
+
        static int test_4_single_long_cast () {
                long a = 1000;
                float d = (float)a;
@@ -206,6 +215,36 @@ class Tests {
                return 4;
        }
 
+       public static int test_0_lconv_to_r8 () {
+               long a = 150;
+               double b = (double) a;
+
+               if (b != 150.0)
+                       return 1;
+               return 0;
+       }
+
+       public static int test_0_lconv_to_r4 () {
+               long a = 3000;
+               float b = (float) a;
+
+               if (b != 3000.0F)
+                       return 1;
+               return 0;
+       }
+
+       static void doit (double value, out long m) {
+               m = (long) value;
+       }
+
+       public static int test_0_ftol_clobber () {
+               long m;
+               doit (1.3, out m);
+               if (m != 1)
+                       return 2;
+               return 0;
+       }
+
        public static int test_0_rounding () {
                long ticks = 631502475130080000L;
                long ticksperday = 864000000000L;