diff --git a/llvm/unittests/Support/AlignOfTest.cpp b/llvm/unittests/Support/AlignOfTest.cpp index c04684676775..388ca11b7769 100644 --- a/llvm/unittests/Support/AlignOfTest.cpp +++ b/llvm/unittests/Support/AlignOfTest.cpp @@ -89,6 +89,8 @@ V6::~V6() {} V7::~V7() {} V8::~V8() {} +template struct T { M m; }; + TEST(AlignOfTest, BasicAlignedArray) { EXPECT_LE(1u, alignof(AlignedCharArrayUnion)); EXPECT_LE(2u, alignof(AlignedCharArrayUnion)); @@ -124,19 +126,20 @@ TEST(AlignOfTest, BasicAlignedArray) { // For other tests we simply assert that the alignment of the union mathes // that of the fundamental type and hope that we have any weird type // productions that would trigger bugs. - EXPECT_EQ(alignof(char), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(short), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(int), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(long), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(long long), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(float), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(double), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(long double), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(void *), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(int *), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(double (*)(double)), + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), + alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); - EXPECT_EQ(alignof(double (S6::*)()), + EXPECT_EQ(alignof(T), alignof(AlignedCharArrayUnion)); EXPECT_EQ(alignof(S1), alignof(AlignedCharArrayUnion)); EXPECT_EQ(alignof(S2), alignof(AlignedCharArrayUnion));