aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/AlignOfTest.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-06-16 09:44:00 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-06-16 09:44:00 +0000
commit3bbbeebd3351a2ef3f208544725f90f92f8ca7d4 (patch)
treef4e7b3cdcd6061e0f05499bee971460910f5cb99 /llvm/unittests/Support/AlignOfTest.cpp
parent8710d886ee48c0b2ddb5fd432dea9800dc83ca7e (diff)
downloadllvm-3bbbeebd3351a2ef3f208544725f90f92f8ca7d4.zip
llvm-3bbbeebd3351a2ef3f208544725f90f92f8ca7d4.tar.gz
llvm-3bbbeebd3351a2ef3f208544725f90f92f8ca7d4.tar.bz2
Relax one assertion -- long double has strange alignments on lots of
platforms. Also, remove one assertion on MSVC because it produces a completely preposterous result, claiming something needs 12-byte alignment. llvm-svn: 158599
Diffstat (limited to 'llvm/unittests/Support/AlignOfTest.cpp')
-rw-r--r--llvm/unittests/Support/AlignOfTest.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/unittests/Support/AlignOfTest.cpp b/llvm/unittests/Support/AlignOfTest.cpp
index c413451..461b1d6 100644
--- a/llvm/unittests/Support/AlignOfTest.cpp
+++ b/llvm/unittests/Support/AlignOfTest.cpp
@@ -139,7 +139,7 @@ TEST(AlignOfTest, BasicAlignmentInvariants) {
EXPECT_LE(alignOf<long>(), alignOf<long long>());
EXPECT_LE(alignOf<char>(), alignOf<float>());
EXPECT_LE(alignOf<float>(), alignOf<double>());
- EXPECT_LE(alignOf<double>(), alignOf<long double>());
+ EXPECT_LE(alignOf<char>(), alignOf<long double>());
EXPECT_LE(alignOf<char>(), alignOf<void *>());
EXPECT_EQ(alignOf<void *>(), alignOf<int *>());
EXPECT_LE(alignOf<char>(), alignOf<S1>());
@@ -246,7 +246,12 @@ TEST(AlignOfTest, BasicAlignedArray) {
EXPECT_EQ(alignOf<V5>(), alignOf<AlignedCharArray<V5>::union_type>());
EXPECT_EQ(alignOf<V6>(), alignOf<AlignedCharArray<V6>::union_type>());
EXPECT_EQ(alignOf<V7>(), alignOf<AlignedCharArray<V7>::union_type>());
+
+ // Some versions of MSVC get this wrong somewhat disturbingly. The failure
+ // appears to be benign: alignOf<V8>() produces a preposterous value: 12
+#ifndef _MSC_VER
EXPECT_EQ(alignOf<V8>(), alignOf<AlignedCharArray<V8>::union_type>());
+#endif
}
}