[mcs] Fixes regression introduced by a0fc3f4dcf571edc997f53066c09671650e96670 to...
[mono.git] / mcs / tests / test-943.cs
index 088e2f74742f2cd71643b4e30ebde7cd4a4da1e4..ace5ef940b4f795d2efdf830dce8b22524dc05ce 100644 (file)
@@ -1,10 +1,18 @@
 using System;
+using System.Runtime.InteropServices;
 
 public struct MyStruct
 {
        public int X { get; set; }
 }
 
+[StructLayout (LayoutKind.Sequential, Pack = 1)]
+public struct MyStruct2
+{
+    public IntPtr handle;
+    public uint type_reference;
+}
+
 class X
 {
        public static int Main ()
@@ -14,6 +22,14 @@ class X
                if (s.StructLayoutAttribute.Size != 0)
                        return 1;
 
+               var s2 = typeof (MyStruct2);
+
+               if (s2.StructLayoutAttribute.Size != 0)
+                       return 2;
+
+               if (s2.StructLayoutAttribute.Pack != 1)
+                       return 3;
+
                return 0;
        }
 }
\ No newline at end of file