summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/AlignmentTest.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2019-09-18 09:24:40 +0000
committerGuillaume Chatelet <gchatelet@google.com>2019-09-18 09:24:40 +0000
commitef8ef1278af826f2489649c30b828e5542302eef (patch)
tree952028c6cc413c16ffbbad42f855d1262d28a5c8 /llvm/unittests/Support/AlignmentTest.cpp
parentd94c7bf06e00582c07fc0e9d215710eb6866f79b (diff)
downloadbcm5719-llvm-ef8ef1278af826f2489649c30b828e5542302eef.tar.gz
bcm5719-llvm-ef8ef1278af826f2489649c30b828e5542302eef.zip
[Alignment] Add a None() member function
Summary: This will allow writing `if(A != llvm::Align::None())` which is clearer than `if(A > llvm::Align(1))` 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: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67697 llvm-svn: 372207
Diffstat (limited to 'llvm/unittests/Support/AlignmentTest.cpp')
-rw-r--r--llvm/unittests/Support/AlignmentTest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/unittests/Support/AlignmentTest.cpp b/llvm/unittests/Support/AlignmentTest.cpp
index 420772541d4..f9cc27b8f42 100644
--- a/llvm/unittests/Support/AlignmentTest.cpp
+++ b/llvm/unittests/Support/AlignmentTest.cpp
@@ -28,7 +28,10 @@ std::vector<uint64_t> getValidAlignments() {
return Out;
}
-TEST(AlignmentTest, AlignDefaultCTor) { EXPECT_EQ(Align().value(), 1ULL); }
+TEST(AlignmentTest, AlignDefaultCTor) {
+ EXPECT_EQ(Align().value(), 1ULL);
+ EXPECT_EQ(Align::None().value(), 1ULL);
+}
TEST(AlignmentTest, MaybeAlignDefaultCTor) {
EXPECT_FALSE(MaybeAlign().hasValue());
OpenPOWER on IntegriCloud