2007-12-23 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Sun, 23 Dec 2007 14:42:13 +0000 (14:42 -0000)
committerMarek Safar <marek.safar@gmail.com>
Sun, 23 Dec 2007 14:42:13 +0000 (14:42 -0000)
A test for bug #346379

svn path=/trunk/mcs/; revision=91834

mcs/tests/test-603.cs [new file with mode: 0644]

diff --git a/mcs/tests/test-603.cs b/mcs/tests/test-603.cs
new file mode 100644 (file)
index 0000000..c32bfb8
--- /dev/null
@@ -0,0 +1,30 @@
+// Compiler options: -unsafe
+
+using System;
+
+namespace ConsoleApplication1
+{
+       public struct Strct
+       {
+               public uint a;
+               public uint b;
+       }
+       
+       unsafe class Program
+       {
+               static Strct* ptr = null;
+               
+               static int Main ()
+               {
+                       Strct* values = ptr;
+                       values++;
+                       values++;
+                       
+                       long diff = values - ptr;
+                       if (diff != 2)
+                               return 1;
+                       
+                       return 0;
+               }
+       }
+}