From: Tanner Gooding Date: Mon, 22 Jan 2018 08:26:21 +0000 (-0800) Subject: Updating the Vector64, Vector128, and Vector256 StructPacking tests. X-Git-Tag: accepted/tizen/unified/20190422.045933~3190^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b20623ef37cd64a44313465110256cabf97d627e;p=platform%2Fupstream%2Fcoreclr.git Updating the Vector64, Vector128, and Vector256 StructPacking tests. --- diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp index f309fbc..859d745 100644 --- a/src/vm/methodtablebuilder.cpp +++ b/src/vm/methodtablebuilder.cpp @@ -9684,6 +9684,9 @@ void MethodTableBuilder::CheckForSystemTypes() pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 4; break; } + + default: + break; } #endif // _TARGET_X86_ && UNIX_X86_ABI diff --git a/tests/src/Interop/StructPacking/StructPacking.cs b/tests/src/Interop/StructPacking/StructPacking.cs index 8871b9a..6df179d 100644 --- a/tests/src/Interop/StructPacking/StructPacking.cs +++ b/tests/src/Interop/StructPacking/StructPacking.cs @@ -1208,17 +1208,48 @@ unsafe class Program { bool succeeded = true; - succeeded &= Test>>( - expectedSize: 24, - expectedOffsetByte: 0, - expectedOffsetValue: 8 - ); + if (RuntimeInformation.OSArchitecture == Architecture.Arm) + { + // The Procedure Call Standard for ARM defines this type as having 8-byte alignment - succeeded &= Test>>( - expectedSize: 24, - expectedOffsetByte: 0, - expectedOffsetValue: 8 - ); + succeeded &= Test>>( + expectedSize: 24, + expectedOffsetByte: 0, + expectedOffsetValue: 8 + ); + + succeeded &= Test>>( + expectedSize: 24, + expectedOffsetByte: 0, + expectedOffsetValue: 8 + ); + + succeeded &= Test>>( + expectedSize: 24, + expectedOffsetByte: 0, + expectedOffsetValue: 8 + ); + } + else + { + succeeded &= Test>>( + expectedSize: 32, + expectedOffsetByte: 0, + expectedOffsetValue: 16 + ); + + succeeded &= Test>>( + expectedSize: 32, + expectedOffsetByte: 0, + expectedOffsetValue: 16 + ); + + succeeded &= Test>>( + expectedSize: 32, + expectedOffsetByte: 0, + expectedOffsetValue: 16 + ); + } succeeded &= Test>>( expectedSize: 17, @@ -1226,12 +1257,6 @@ unsafe class Program expectedOffsetValue: 1 ); - succeeded &= Test>>( - expectedSize: 24, - expectedOffsetByte: 0, - expectedOffsetValue: 8 - ); - if (Environment.Is64BitProcess) { succeeded &= Test>>( @@ -1280,17 +1305,70 @@ unsafe class Program { bool succeeded = true; - succeeded &= Test>>( - expectedSize: 40, - expectedOffsetByte: 0, - expectedOffsetValue: 8 - ); + if (RuntimeInformation.OSArchitecture == Architecture.Arm) + { + // The Procedure Call Standard for ARM defines this type as having 8-byte alignment - succeeded &= Test>>( - expectedSize: 40, - expectedOffsetByte: 0, - expectedOffsetValue: 8 - ); + succeeded &= Test>>( + expectedSize: 40, + expectedOffsetByte: 0, + expectedOffsetValue: 8 + ); + + succeeded &= Test>>( + expectedSize: 40, + expectedOffsetByte: 0, + expectedOffsetValue: 8 + ); + + succeeded &= Test>>( + expectedSize: 40, + expectedOffsetByte: 0, + expectedOffsetValue: 8 + ); + } + else if (RuntimeInformation.OSArchitecture == Architecture.Arm64) + { + // The Procedure Call Standard for ARM64 defines this type as having 16-byte alignment + + succeeded &= Test>>( + expectedSize: 48, + expectedOffsetByte: 0, + expectedOffsetValue: 16 + ); + + succeeded &= Test>>( + expectedSize: 48, + expectedOffsetByte: 0, + expectedOffsetValue: 16 + ); + + succeeded &= Test>>( + expectedSize: 48, + expectedOffsetByte: 0, + expectedOffsetValue: 16 + ); + } + else + { + succeeded &= Test>>( + expectedSize: 64, + expectedOffsetByte: 0, + expectedOffsetValue: 32 + ); + + succeeded &= Test>>( + expectedSize: 64, + expectedOffsetByte: 0, + expectedOffsetValue: 32 + ); + + succeeded &= Test>>( + expectedSize: 64, + expectedOffsetByte: 0, + expectedOffsetValue: 32 + ); + } succeeded &= Test>>( expectedSize: 33, @@ -1298,12 +1376,6 @@ unsafe class Program expectedOffsetValue: 1 ); - succeeded &= Test>>( - expectedSize: 40, - expectedOffsetByte: 0, - expectedOffsetValue: 8 - ); - if (Environment.Is64BitProcess) { succeeded &= Test>>(