[2020-02] Avoid following invalid pointers in mono_w32process_get_modules on Darwin...
[mono-project.git] / mono / tests / struct-explicit-layout.cs
blob5c5e099295bcc4df9589b8a34cb058e411058100
1 using System;
2 using System.Runtime.InteropServices;
4 namespace Test {
5 [StructLayout ( LayoutKind.Explicit )]
6 public struct ST0 {
7 [FieldOffset(0)] public short S0;
8 [FieldOffset(2)] public int I0;
9 [FieldOffset(6)] public long L0;
10 [FieldOffset(14)] public float F0;
11 [FieldOffset(18)] public double D0;
14 public class Test {
15 public static int Main() {
16 ST0 s0, s1;
17 s0 = s1 = new ST0();
18 return s0.Equals (s1) ? 0 : 1;