aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorGalina Kistanova <gkistanova@gmail.com>2017-06-15 21:00:40 +0000
committerGalina Kistanova <gkistanova@gmail.com>2017-06-15 21:00:40 +0000
commitfcae62d6eeabf0eb926555d56e6a79d880ef094b (patch)
treeb8c21b18da971b9c5ea78ddef9a16c1ddd1500db /llvm/unittests/Support/CommandLineTest.cpp
parentda504b794cf3154ec9b3f0fb728f1b3880a8bb77 (diff)
downloadllvm-fcae62d6eeabf0eb926555d56e6a79d880ef094b.zip
llvm-fcae62d6eeabf0eb926555d56e6a79d880ef094b.tar.gz
llvm-fcae62d6eeabf0eb926555d56e6a79d880ef094b.tar.bz2
Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC.
llvm-svn: 305506
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 7fdd42b..f9dc393 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -180,8 +180,9 @@ void testCommandLineTokenizer(ParserFunction *parse, StringRef Input,
parse(Input, Saver, Actual, /*MarkEOLs=*/false);
EXPECT_EQ(OutputSize, Actual.size());
for (unsigned I = 0, E = Actual.size(); I != E; ++I) {
- if (I < OutputSize)
+ if (I < OutputSize) {
EXPECT_STREQ(Output[I], Actual[I]);
+ }
}
}
@@ -528,8 +529,9 @@ TEST(CommandLineTest, GetRegisteredSubcommands) {
EXPECT_FALSE(Opt1);
EXPECT_FALSE(Opt2);
for (auto *S : cl::getRegisteredSubcommands()) {
- if (*S)
+ if (*S) {
EXPECT_EQ("sc1", S->getName());
+ }
}
cl::ResetAllOptionOccurrences();
@@ -538,8 +540,9 @@ TEST(CommandLineTest, GetRegisteredSubcommands) {
EXPECT_FALSE(Opt1);
EXPECT_FALSE(Opt2);
for (auto *S : cl::getRegisteredSubcommands()) {
- if (*S)
+ if (*S) {
EXPECT_EQ("sc2", S->getName());
+ }
}
}