summaryrefslogtreecommitdiff
path: root/tests/src/CoreMangLib/cti/system
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/CoreMangLib/cti/system')
-rw-r--r--tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs12
-rw-r--r--tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof2.cs12
2 files changed, 22 insertions, 2 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);
diff --git a/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof2.cs b/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof2.cs
index eac0ab60d7..6882ad0489 100644
--- a/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof2.cs
+++ b/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof2.cs
@@ -210,7 +210,17 @@ public class MarshalSizeOf2
try
{
Type obj = typeof(TestMultiMemberStruct1);
- 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);