Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / test-643.cs
index f7204392ff0f28660a209d17185bcab900ead40d..c88ac8885e5c075d882071ae3aa485b599ff5091 100644 (file)
@@ -11,7 +11,10 @@ class PointerArithmeticTest
                } catch (System.OverflowException) {}
                
                try {
-                       return CheckSub((short*)(-1), int.MaxValue);
+                       if (IntPtr.Size <= 4)
+                               return CheckSub((short*)(-1), int.MaxValue);
+                       else
+                               return CheckSub((short*)(-1), long.MaxValue);
                } catch (System.OverflowException) {}
                
                CheckSub2((short*)(-1), int.MaxValue);
@@ -44,6 +47,14 @@ class PointerArithmeticTest
                return 102;
        }
 
+       unsafe static int CheckSub(short* ptr, long offset)
+       {
+               if (checked(ptr - offset < ptr))
+                       return 2;
+
+               return 102;
+       }
+
        unsafe static int CheckSub2(short* ptr, int offset)
        {
                short* b = ptr + offset;