summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>2018-05-03 19:57:26 (GMT)
committerGleb Balykov <g.balykov@samsung.com>2018-09-18 12:49:14 (GMT)
commite15bd6545ad4d917eeafaf91a725b12f84c20ec2 (patch)
treec0082b2f30bd7adc7596175b5943a6588146a5f5
parent0b1ae828120511fb61024c2f03c5d1b9e4e799d0 (diff)
downloadcoreclr-e15bd6545ad4d917eeafaf91a725b12f84c20ec2.zip
coreclr-e15bd6545ad4d917eeafaf91a725b12f84c20ec2.tar.gz
coreclr-e15bd6545ad4d917eeafaf91a725b12f84c20ec2.tar.bz2
[Linux/x86] Fix tests in case of 4-byte alignment for 64-bit types (#17829)
JIT/Directed/RVAInit/nested JIT/Directed/RVAInit/simple JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b103058/b103058
-rw-r--r--tests/src/JIT/Directed/RVAInit/nested.il4
-rw-r--r--tests/src/JIT/Directed/RVAInit/simple.il3
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b103058/b103058.cs15
3 files changed, 17 insertions, 5 deletions
diff --git a/tests/src/JIT/Directed/RVAInit/nested.il b/tests/src/JIT/Directed/RVAInit/nested.il
index fbe537a..9b52721 100644
--- a/tests/src/JIT/Directed/RVAInit/nested.il
+++ b/tests/src/JIT/Directed/RVAInit/nested.il
@@ -35,6 +35,7 @@
.field public int64 _long
.field public unsigned int64 _ulong
.field public float32 _float
+ .field public unsigned int32 _pad
.field public float64 _double
} // end of class Internal
@@ -42,6 +43,7 @@
extends [mscorlib]System.ValueType
{
.field public unsigned int8 _byte
+ .field public unsigned int32 _pad
.field public valuetype Internal intern
.field public int8 _sbyte
.field public int16 _short
@@ -251,4 +253,4 @@
66 45 13 02 66 45 13 02 66 45 13 02 00 00 00 00
66 45 13 02 00 00 00 00 83 00 8C 42 00 00 00 00
E3 A5 9B C4 20 00 54 40 6F 00 39 30 22 C8 00 00
- ) \ No newline at end of file
+ )
diff --git a/tests/src/JIT/Directed/RVAInit/simple.il b/tests/src/JIT/Directed/RVAInit/simple.il
index 83b5490..f35856f 100644
--- a/tests/src/JIT/Directed/RVAInit/simple.il
+++ b/tests/src/JIT/Directed/RVAInit/simple.il
@@ -24,6 +24,7 @@
.field public int64 _long
.field public unsigned int64 _ulong
.field public float32 _float
+ .field public unsigned int32 _pad
.field public float64 _double
.field public static valuetype Test static_test at D_1
.method private hidebysig static char hex(unsigned int8 v) cil managed
@@ -235,4 +236,4 @@
.data D_1 = bytearray( DE 6F 39 30 22 C8 00 00 66 45 13 02 66 45 13 02
66 45 13 02 00 00 00 00 66 45 13 02 00 00 00 00
83 00 8C 42 00 00 00 00 E3 A5 9B C4 20 00 54 40
- ) \ No newline at end of file
+ )
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b103058/b103058.cs b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b103058/b103058.cs
index 0d56c46..c9639cc 100644
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b103058/b103058.cs
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b103058/b103058.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
+using System.Runtime.InteropServices;
internal struct VT
{
@@ -20,13 +21,21 @@ internal unsafe class test
private static unsafe bool CheckDoubleAlignment1(VT* p)
{
Console.WriteLine("Address {0}", (IntPtr)p);
- if ((int)(long)p % sizeof(double) != 0)
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (RuntimeInformation.ProcessArchitecture != Architecture.X86))
{
- Console.WriteLine("not double aligned");
- return false;
+ if ((int)(long)p % sizeof(double) != 0)
+ {
+ Console.WriteLine("not double aligned");
+ return false;
+ }
+ else
+ {
+ return true;
+ }
}
else
{
+ // Current JIT implementation doesn't use double alignment stack optimization for Linux/x86
return true;
}
}