diff options
| author | Guillaume Chatelet <gchatelet@google.com> | 2019-10-03 10:53:10 +0000 |
|---|---|---|
| committer | Guillaume Chatelet <gchatelet@google.com> | 2019-10-03 10:53:10 +0000 |
| commit | b3af236fb5fc6e50fcc1b54d868f0bff557f3fb1 (patch) | |
| tree | 0e456c8eba2f808a14811811045f18a3a9e66deb /llvm/unittests/Support/AlignmentTest.cpp | |
| parent | abc35f1bd8e2d27029dae4752957b83f562011ce (diff) | |
| download | bcm5719-llvm-b3af236fb5fc6e50fcc1b54d868f0bff557f3fb1.tar.gz bcm5719-llvm-b3af236fb5fc6e50fcc1b54d868f0bff557f3fb1.zip | |
[Alignment][NFC] Allow constexpr Align
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68329
llvm-svn: 373580
Diffstat (limited to 'llvm/unittests/Support/AlignmentTest.cpp')
| -rw-r--r-- | llvm/unittests/Support/AlignmentTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/Support/AlignmentTest.cpp b/llvm/unittests/Support/AlignmentTest.cpp index 0b1435912b9..3d35a612b83 100644 --- a/llvm/unittests/Support/AlignmentTest.cpp +++ b/llvm/unittests/Support/AlignmentTest.cpp @@ -44,6 +44,16 @@ TEST(AlignmentTest, ValidCTors) { } } +TEST(AlignmentTest, CompileTimeConstant) { + EXPECT_EQ(Align::Constant<1>(), Align(1)); + EXPECT_EQ(Align::Constant<2>(), Align(2)); + EXPECT_EQ(Align::Constant<4>(), Align(4)); + EXPECT_EQ(Align::Constant<8>(), Align(8)); + EXPECT_EQ(Align::Constant<16>(), Align(16)); + EXPECT_EQ(Align::Constant<32>(), Align(32)); + EXPECT_EQ(Align::Constant<64>(), Align(64)); +} + TEST(AlignmentTest, CheckMaybeAlignHasValue) { EXPECT_TRUE(MaybeAlign(1)); EXPECT_TRUE(MaybeAlign(1).hasValue()); |

