Author: zoltan
Date: 2005-06-10 15:02:59 -0400 (Fri, 10 Jun 2005)
New Revision: 45790

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/basic.cs
Log:
2005-06-10  Zoltan Varga  <[EMAIL PROTECTED]>

        * basic.cs: Add tests for sub.ovf.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2005-06-10 18:49:21 UTC (rev 45789)
+++ trunk/mono/mono/mini/ChangeLog      2005-06-10 19:02:59 UTC (rev 45790)
@@ -1,5 +1,7 @@
 2005-06-10  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * basic.cs: Add tests for sub.ovf.
+
        * *-ia64.*: Ongoing IA64 work.
 
 2005-06-09  Zoltan Varga  <[EMAIL PROTECTED]>

Modified: trunk/mono/mono/mini/basic.cs
===================================================================
--- trunk/mono/mono/mini/basic.cs       2005-06-10 18:49:21 UTC (rev 45789)
+++ trunk/mono/mono/mini/basic.cs       2005-06-10 19:02:59 UTC (rev 45790)
@@ -307,6 +307,90 @@
                return number == n ? 0 : 1;
        }
 
+       public static int test_0_sub_ovf () {
+               int i, j, k;
+
+               checked {
+                       i = System.Int32.MinValue;
+                       j = 0;
+                       k = i - j;
+               }
+
+               if (k != System.Int32.MinValue)
+                       return 1;
+
+               checked {
+                       i = System.Int32.MaxValue;
+                       j = 0;
+                       k = i - j;
+               }
+
+               if (k != System.Int32.MaxValue)
+                       return 2;
+
+               checked {
+                       i = System.Int32.MinValue;
+                       j = System.Int32.MinValue + 1234;
+                       k = i - j;
+               }
+
+               if (k != -1234)
+                       return 3;
+
+               checked {
+                       i = System.Int32.MaxValue;
+                       j = 1234;
+                       k = i - j;
+               }
+
+               if (k != System.Int32.MaxValue - 1234)
+                       return 4;
+
+               checked {
+                       i = System.Int32.MaxValue - 1234;
+                       j = -1234;
+                       k = i - j;
+               }
+
+               if (k != System.Int32.MaxValue)
+                       return 5;
+
+               checked {
+                       i = System.Int32.MinValue + 1234;
+                       j = 1234;
+                       k = i - j;
+               }
+
+               if (k != System.Int32.MinValue)
+                       return 6;
+
+               return 0;
+       }
+
+       public static int test_0_sub_ovf_un () {
+               uint i, j, k;
+
+               checked {
+                       i = System.UInt32.MaxValue;
+                       j = 0;
+                       k = i - j;
+               }
+
+               if (k != System.UInt32.MaxValue)
+                       return 1;
+
+               checked {
+                       i = System.UInt32.MaxValue;
+                       j = System.UInt32.MaxValue;
+                       k = i - j;
+               }
+
+               if (k != 0)
+                       return 2;
+
+               return 0;
+       }
+
        public static int test_3_or () {
                int b = 2;
                int a = 3;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to