1 // Compiler options: -unsafe -r:gtest-166-lib.dll
6 using System
.Runtime
.InteropServices
;
8 //[module: DefaultCharSet (CharSet.Ansi)]
10 [StructLayout(LayoutKind
.Sequential
, CharSet
= CharSet
.Unicode
)]
11 public unsafe struct TestNew
{
12 private fixed char test_1
[128];
13 public fixed bool test2
[4];
15 public fixed int T
[2];
16 public fixed bool test20
[4], test21
[40];
18 private int foo
, foo2
;
19 public void SetTest () {
20 fixed (char* c
= test_1
) {
27 unsafe static int Test () {
28 TestNew tt
= new TestNew ();
35 ExternalStruct es
= new ExternalStruct ();
36 es
.double_buffer
[1] = 999999.8888;
37 es
.double_buffer
[0] = es
.double_buffer
[1];
40 if (Attribute
.GetCustomAttribute (typeof (TestNew
).GetField ("test2"), typeof (System
.Runtime
.CompilerServices
.FixedBufferAttribute
)) == null)
44 if (typeof (TestNew
).GetNestedTypes ().Length
!= 5)
47 foreach (Type t
in typeof (TestNew
).GetNestedTypes ()) {
48 if (Attribute
.GetCustomAttribute (t
, typeof (System
.Runtime
.CompilerServices
.CompilerGeneratedAttribute
)) == null)
51 if (Attribute
.GetCustomAttribute (t
, typeof (System
.Runtime
.CompilerServices
.UnsafeValueTypeAttribute
)) == null)
54 if (!t
.IsUnicodeClass
)
58 Console
.WriteLine ("OK");
62 public static int Main () {