aboutsummaryrefslogtreecommitdiff
path: root/unittests/Support/AlignOfTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-03-14 10:51:38 +0000
committerAlexander Kornienko <alexfh@google.com>2013-03-14 10:51:38 +0000
commit647735c781c5b37061ee03d6e9e6c7dda92218e2 (patch)
tree5a5e56606d41060263048b5a5586b3d2380898ba /unittests/Support/AlignOfTest.cpp
parent6aed25d93d1cfcde5809a73ffa7dc1b0d6396f66 (diff)
parentf635ef401786c84df32090251a8cf45981ecca33 (diff)
Updating branches/google/stable to r176857
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/stable@177040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/AlignOfTest.cpp')
-rw-r--r--unittests/Support/AlignOfTest.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/unittests/Support/AlignOfTest.cpp b/unittests/Support/AlignOfTest.cpp
index b518f3b861..40f7295857 100644
--- a/unittests/Support/AlignOfTest.cpp
+++ b/unittests/Support/AlignOfTest.cpp
@@ -14,7 +14,6 @@
using namespace llvm;
namespace {
-
// Disable warnings about questionable type definitions.
// We're testing that even questionable types work with the alignment utilities.
#ifdef _MSC_VER
@@ -321,6 +320,16 @@ TEST(AlignOfTest, BasicAlignedArray) {
#ifndef _MSC_VER
EXPECT_EQ(sizeof(V8), sizeof(AlignedCharArrayUnion<V8>));
#endif
-}
+ EXPECT_EQ(1u, (alignOf<AlignedCharArray<1, 1> >()));
+ EXPECT_EQ(2u, (alignOf<AlignedCharArray<2, 1> >()));
+ EXPECT_EQ(4u, (alignOf<AlignedCharArray<4, 1> >()));
+ EXPECT_EQ(8u, (alignOf<AlignedCharArray<8, 1> >()));
+ EXPECT_EQ(16u, (alignOf<AlignedCharArray<16, 1> >()));
+
+ EXPECT_EQ(1u, sizeof(AlignedCharArray<1, 1>));
+ EXPECT_EQ(7u, sizeof(AlignedCharArray<1, 7>));
+ EXPECT_EQ(2u, sizeof(AlignedCharArray<2, 2>));
+ EXPECT_EQ(16u, sizeof(AlignedCharArray<2, 16>));
+}
}