summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/AlignmentTest.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2019-08-03 00:26:10 +0000
committerBill Wendling <isanbard@gmail.com>2019-08-03 00:26:10 +0000
commit383650c7f19b5b6892c572df06b280eb90afef37 (patch)
treee89d3d3e9f83ca2427f330cc8bad0528544425dd /llvm/unittests/Support/AlignmentTest.cpp
parentc835164a47e5997048a547806e5e447a380b8875 (diff)
downloadbcm5719-llvm-383650c7f19b5b6892c572df06b280eb90afef37.tar.gz
bcm5719-llvm-383650c7f19b5b6892c572df06b280eb90afef37.zip
Add brackets to remove warnings about ambiguous 'else's.
llvm-svn: 367740
Diffstat (limited to 'llvm/unittests/Support/AlignmentTest.cpp')
-rw-r--r--llvm/unittests/Support/AlignmentTest.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/unittests/Support/AlignmentTest.cpp b/llvm/unittests/Support/AlignmentTest.cpp
index 4730ad2d3c3..0e251eb4921 100644
--- a/llvm/unittests/Support/AlignmentTest.cpp
+++ b/llvm/unittests/Support/AlignmentTest.cpp
@@ -83,8 +83,9 @@ TEST(AlignmentTest, AlignTo) {
// Test MaybeAlign
EXPECT_EQ(alignTo(T.offset, A), T.rounded);
// Test Align
- if (A)
+ if (A) {
EXPECT_EQ(alignTo(T.offset, A.getValue()), T.rounded);
+ }
}
}
@@ -112,12 +113,15 @@ TEST(AlignmentTest, MinAlign) {
for (const auto &T : kTests) {
EXPECT_EQ(commonAlignment(MaybeAlign(T.A), MaybeAlign(T.B)), T.MinAlign);
EXPECT_EQ(MinAlign(T.A, T.B), T.MinAlign);
- if (T.A)
+ if (T.A) {
EXPECT_EQ(commonAlignment(Align(T.A), MaybeAlign(T.B)), T.MinAlign);
- if (T.B)
+ }
+ if (T.B) {
EXPECT_EQ(commonAlignment(MaybeAlign(T.A), Align(T.B)), T.MinAlign);
- if (T.A && T.B)
+ }
+ if (T.A && T.B) {
EXPECT_EQ(commonAlignment(Align(T.A), Align(T.B)), T.MinAlign);
+ }
}
}
@@ -155,8 +159,9 @@ TEST(AlignmentTest, isAligned) {
// Test MaybeAlign
EXPECT_EQ(isAligned(A, T.offset), T.isAligned);
// Test Align
- if (A)
+ if (A) {
EXPECT_EQ(isAligned(A.getValue(), T.offset), T.isAligned);
+ }
}
}
OpenPOWER on IntegriCloud