Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-fixedbuffer-08.cs
1 // Compiler options: -unsafe
2
3 using System;
4 using System.Runtime.InteropServices;
5
6 [StructLayout (LayoutKind.Auto, CharSet = CharSet.Auto)]
7 struct S
8 {
9         public unsafe fixed byte o[6];
10 }
11
12 class A
13 {
14         public static int Main ()
15         {
16                 Type t = typeof (S);
17                 var sa = t.StructLayoutAttribute;
18                 if (sa.Value != LayoutKind.Auto)
19                         return 1;
20
21                 if (sa.CharSet != CharSet.Auto)
22                         return 2;
23
24                 if (sa.Pack != 8)
25                         return 3;
26
27                 if (sa.Size != 0)
28                         return 4;
29
30                 t = t.GetNestedTypes ()[0];
31                 sa = t.StructLayoutAttribute;
32                 if (sa.Value != LayoutKind.Sequential)
33                         return 11;
34
35                 if (sa.CharSet != CharSet.Auto)
36                         return 12;
37
38                 if (sa.Pack != 8)
39                         return 13;
40
41                 if (sa.Size != 6)
42                         return 14;
43
44                 return 0;
45         }
46 }