[jit] Disable the optimization added by 63eb94e451a59491034516f2ec9f27d586b34d86...
[mono.git] / mono / mini / basic-float.cs
index 70c2cc181113206791a050b9e9928fce355cbed5..11e3e2725b181f350d220009244a4f37b72986ec 100644 (file)
@@ -26,11 +26,18 @@ using System.Reflection;
 /* A comparison made to same variable. */
 #pragma warning disable 1718
 
-class Tests {
-
-       public static int Main () {
-               return TestDriver.RunTests (typeof (Tests));
+#if MOBILE
+class FloatTests
+#else
+class Tests
+#endif
+{
+
+#if !MOBILE
+       public static int Main (string[] args) {
+               return TestDriver.RunTests (typeof (Tests), args);
        }
+#endif
        
        public static int test_0_beq () {
                double a = 2.0;
@@ -73,6 +80,20 @@ class Tests {
                sbyte sb = (sbyte)a;
                if (sb != 2)
                        return 6;
+               /* MS.NET special cases these */
+               double d = Double.NaN;
+               ui = (uint)d;
+               if (ui != 0)
+                       return 7;
+               d = Double.PositiveInfinity;
+               ui = (uint)d;
+               if (ui != 0)
+                       return 8;
+               d = Double.NegativeInfinity;
+               ui = (uint)d;
+               if (ui != 0)
+                       return 9;
+
                return 0;
        }
 
@@ -82,6 +103,12 @@ class Tests {
                return (int)f;
        }
 
+       public static int test_0_conv_r4_m1 () {
+               int i = -1;
+               float f = (float)i;
+               return (int)f + 1;
+       }
+
        public static int test_5_double_conv_r4 () {
                double d = 5.0;
                float f = (float)d;
@@ -201,6 +228,10 @@ class Tests {
                ulong b = (ulong)d;
                if (b != 1000)
                        return 0;
+               a = 0xffffffffffffffff;
+               float f = (float)a;
+               if (!(f > 0f))
+                       return 1;
                return 4;
        }