diff --git a/unittests/ADT/SCCIteratorTest.cpp b/unittests/ADT/SCCIteratorTest.cpp index ca6d84ed2f3..57a999bea9d 100644 --- a/unittests/ADT/SCCIteratorTest.cpp +++ b/unittests/ADT/SCCIteratorTest.cpp @@ -63,8 +63,9 @@ TEST(SCCIteratorTest, AllSmallGraphs) { // Check that every node in the SCC is reachable from every other node in // the SCC. for (unsigned i = 0; i != NUM_NODES; ++i) - if (NodesInThisSCC.count(i)) + if (NodesInThisSCC.count(i)) { EXPECT_TRUE(NodesInThisSCC.isSubsetOf(G.NodesReachableFrom(i))); + } // OK, now that we now that every node in the SCC is reachable from every // other, this means that the set of nodes reachable from any node in the @@ -78,8 +79,9 @@ TEST(SCCIteratorTest, AllSmallGraphs) { NodesReachableFromSCC.Meet(NodesInThisSCC.Complement()); for (unsigned j = 0; j != NUM_NODES; ++j) - if (ReachableButNotInSCC.count(j)) + if (ReachableButNotInSCC.count(j)) { EXPECT_TRUE(G.NodesReachableFrom(j).Meet(NodesInThisSCC).isEmpty()); + } // The result must be the same for all other nodes in this SCC, so // there is no point in checking them. diff --git a/unittests/ADT/StringRefTest.cpp b/unittests/ADT/StringRefTest.cpp index e308f2d7c64..0684afe678f 100644 --- a/unittests/ADT/StringRefTest.cpp +++ b/unittests/ADT/StringRefTest.cpp @@ -882,8 +882,9 @@ TEST(StringRefTest, getAsDouble) { double Result; StringRef S(Entry.Str); EXPECT_EQ(Entry.ShouldFail, S.getAsDouble(Result, Entry.AllowInexact)); - if (!Entry.ShouldFail) + if (!Entry.ShouldFail) { EXPECT_EQ(Result, Entry.D); + } } } diff --git a/unittests/CodeGen/LowLevelTypeTest.cpp b/unittests/CodeGen/LowLevelTypeTest.cpp index 428d6b93f79..11555464290 100644 --- a/unittests/CodeGen/LowLevelTypeTest.cpp +++ b/unittests/CodeGen/LowLevelTypeTest.cpp @@ -137,8 +137,9 @@ TEST(LowLevelTypeTest, Vector) { if ((Elts % 2) == 0) { EXPECT_EQ(S * (Elts / 2), HalfEltIfEvenTy.getSizeInBits()); EXPECT_EQ(S, HalfEltIfEvenTy.getScalarSizeInBits()); - if (Elts > 2) + if (Elts > 2) { EXPECT_EQ(Elts / 2, HalfEltIfEvenTy.getNumElements()); + } } EXPECT_EQ(S * (Elts * 2), DoubleEltTy.getSizeInBits()); diff --git a/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp index 18cab52a81b..bf004d6ffc2 100644 --- a/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp +++ b/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp @@ -311,8 +311,9 @@ void TestAllForms() { EXPECT_EQ(Data2, toReference(DieDG.find(Attr_DW_FORM_ref2), 0)); EXPECT_EQ(Data4, toReference(DieDG.find(Attr_DW_FORM_ref4), 0)); EXPECT_EQ(Data8, toReference(DieDG.find(Attr_DW_FORM_ref8), 0)); - if (Version >= 4) + if (Version >= 4) { EXPECT_EQ(Data8_2, toReference(DieDG.find(Attr_DW_FORM_ref_sig8), 0)); + } EXPECT_EQ(UData[0], toReference(DieDG.find(Attr_DW_FORM_ref_udata), 0)); //---------------------------------------------------------------------- @@ -320,15 +321,17 @@ void TestAllForms() { //---------------------------------------------------------------------- EXPECT_EQ(1ULL, toUnsigned(DieDG.find(Attr_DW_FORM_flag_true), 0)); EXPECT_EQ(0ULL, toUnsigned(DieDG.find(Attr_DW_FORM_flag_false), 1)); - if (Version >= 4) + if (Version >= 4) { EXPECT_EQ(1ULL, toUnsigned(DieDG.find(Attr_DW_FORM_flag_present), 0)); + } //---------------------------------------------------------------------- // Test SLEB128 based forms //---------------------------------------------------------------------- EXPECT_EQ(SData, toSigned(DieDG.find(Attr_DW_FORM_sdata), 0)); - if (Version >= 5) + if (Version >= 5) { EXPECT_EQ(ICSData, toSigned(DieDG.find(Attr_DW_FORM_implicit_const), 0)); + } //---------------------------------------------------------------------- // Test ULEB128 based forms @@ -340,9 +343,10 @@ void TestAllForms() { //---------------------------------------------------------------------- EXPECT_EQ(Dwarf32Values[0], toReference(DieDG.find(Attr_DW_FORM_GNU_ref_alt), 0)); - if (Version >= 4) + if (Version >= 4) { EXPECT_EQ(Dwarf32Values[1], toSectionOffset(DieDG.find(Attr_DW_FORM_sec_offset), 0)); + } //---------------------------------------------------------------------- // Add an address at the end to make sure we can decode this value diff --git a/unittests/Support/CommandLineTest.cpp b/unittests/Support/CommandLineTest.cpp index 7fdd42b4fec..f9dc3930df8 100644 --- a/unittests/Support/CommandLineTest.cpp +++ b/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()); + } } }