summaryrefslogtreecommitdiff
path: root/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs')
-rw-r--r--tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs b/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs
index 030e767bac..c0d16b8623 100644
--- a/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs
+++ b/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs
@@ -225,7 +225,17 @@ public class MarshalSizeOf1
TestMultiMemberStruct1 obj = new TestMultiMemberStruct1();
obj.TestInt = TestLibrary.Generator.GetInt32(-55);
obj.TestDouble = TestLibrary.Generator.GetDouble(-55);
- int expectedSize = 16; // sizeof(double) + sizeof(int) + padding
+ int expectedSize;
+
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (RuntimeInformation.ProcessArchitecture != Architecture.X86))
+ {
+ expectedSize = 16; // sizeof(double) + sizeof(int) + padding
+ }
+ else
+ {
+ // The System V ABI for i386 defines double as having 4-byte alignment
+ expectedSize = 12; // sizeof(double) + sizeof(int)
+ }
int actualSize = Marshal.SizeOf(obj);