2 using System.Runtime.InteropServices;
6 Console.WriteLine("Hello, world!");
10 [StructLayout(LayoutKind.Explicit)]
12 [FieldOffset(0)] public short a;
13 [FieldOffset(2)] public Z z; // Unaligned reference
23 static void test2(X x) {
24 Console.WriteLine("Object: " + x);
32 System.GC.WaitForPendingFinalizers();
34 } catch (TypeLoadException e) {
35 Console.WriteLine ("got correct exception: {0}", e);