Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 32b587d

Browse files
lewurmstephentoub
authored andcommitted
UnsafeTests: force explicit layout, so tests work on 32bit and 64bit platforms (#25594)
1 parent 3111dee commit 32b587d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/System.Runtime.CompilerServices.Unsafe/tests/UnsafeTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,9 +792,12 @@ public unsafe struct Byte512
792792
public fixed byte Bytes[512];
793793
}
794794

795+
[StructLayout(LayoutKind.Explicit, Size=16)]
795796
public unsafe struct Int32Double
796797
{
798+
[FieldOffset(0)]
797799
public int Int32;
800+
[FieldOffset(8)]
798801
public double Double;
799802

800803
public static unsafe byte[] Unaligned(int i, double d)

0 commit comments

Comments
 (0)