1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[AIX] Use less than or equal to for some alignment tests on AIX

On AIX the alignment implementation has the storage aligned to the
preferred alignment instead of the alignment of a type. Macro guard
these tests for AIX and have them pass when the "reference alignment" is
less than or equal to the alignment observed. In other words, the
alignment applied is at least as strict as the required alignment.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D104786
This commit is contained in:
Zarko Todorovski 2021-06-28 10:31:55 -04:00
parent a82143ea32
commit a96f500c09

View File

@ -131,9 +131,17 @@ TEST(AlignOfTest, BasicAlignedArray) {
EXPECT_EQ(alignof(T<long>), alignof(AlignedCharArrayUnion<long>));
EXPECT_EQ(alignof(T<long long>), alignof(AlignedCharArrayUnion<long long>));
EXPECT_EQ(alignof(T<float>), alignof(AlignedCharArrayUnion<float>));
#ifdef _AIX
EXPECT_LE(alignof(T<double>), alignof(AlignedCharArrayUnion<double>));
EXPECT_LE(alignof(T<long double>),
alignof(AlignedCharArrayUnion<long double>));
EXPECT_LE(alignof(S4), alignof(AlignedCharArrayUnion<S4>));
#else
EXPECT_EQ(alignof(T<double>), alignof(AlignedCharArrayUnion<double>));
EXPECT_EQ(alignof(T<long double>),
alignof(AlignedCharArrayUnion<long double>));
EXPECT_EQ(alignof(S4), alignof(AlignedCharArrayUnion<S4>));
#endif
EXPECT_EQ(alignof(T<void *>), alignof(AlignedCharArrayUnion<void *>));
EXPECT_EQ(alignof(T<int *>), alignof(AlignedCharArrayUnion<int *>));
EXPECT_EQ(alignof(T<double (*)(double)>),
@ -143,7 +151,6 @@ TEST(AlignOfTest, BasicAlignedArray) {
EXPECT_EQ(alignof(S1), alignof(AlignedCharArrayUnion<S1>));
EXPECT_EQ(alignof(S2), alignof(AlignedCharArrayUnion<S2>));
EXPECT_EQ(alignof(S3), alignof(AlignedCharArrayUnion<S3>));
EXPECT_EQ(alignof(S4), alignof(AlignedCharArrayUnion<S4>));
EXPECT_EQ(alignof(S5), alignof(AlignedCharArrayUnion<S5>));
EXPECT_EQ(alignof(S6), alignof(AlignedCharArrayUnion<S6>));
EXPECT_EQ(alignof(D1), alignof(AlignedCharArrayUnion<D1>));