Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-943.cs
1 using System;
2 using System.Runtime.InteropServices;
3
4 public struct MyStruct
5 {
6         public int X { get; set; }
7 }
8
9 [StructLayout (LayoutKind.Sequential, Pack = 1)]
10 public struct MyStruct2
11 {
12     public IntPtr handle;
13     public uint type_reference;
14 }
15
16 class X
17 {
18         public static int Main ()
19         {
20                 var s = typeof (MyStruct);
21
22                 if (s.StructLayoutAttribute.Size != 0)
23                         return 1;
24
25                 var s2 = typeof (MyStruct2);
26
27                 if (s2.StructLayoutAttribute.Size != 0)
28                         return 2;
29
30                 if (s2.StructLayoutAttribute.Pack != 1)
31                         return 3;
32
33                 return 0;
34         }
35 }