Skip to content

Commit 5790f9f

Browse files
author
git apple-llvm automerger
committed
Merge commit 'd76b56fd2858' from llvm.org/main into next
2 parents fe15a1c + d76b56f commit 5790f9f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clang/unittests/Serialization/SourceLocationEncodingTest.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ void roundTrip(SourceLocation::UIntTy Loc,
2525
std::optional<uint64_t> ExpectedEncoded = std::nullopt) {
2626
uint64_t ActualEncoded =
2727
SourceLocationEncoding::encode(SourceLocation::getFromRawEncoding(Loc));
28-
if (ExpectedEncoded)
28+
if (ExpectedEncoded) {
2929
ASSERT_EQ(ActualEncoded, *ExpectedEncoded) << "Encoding " << Loc;
30+
}
3031
SourceLocation::UIntTy DecodedEncoded =
3132
SourceLocationEncoding::decode(ActualEncoded).getRawEncoding();
3233
ASSERT_EQ(DecodedEncoded, Loc) << "Decoding " << ActualEncoded;
@@ -41,9 +42,10 @@ void roundTrip(std::vector<SourceLocation::UIntTy> Locs,
4142
for (auto L : Locs)
4243
ActualEncoded.push_back(SourceLocationEncoding::encode(
4344
SourceLocation::getFromRawEncoding(L), Seq));
44-
if (!ExpectedEncoded.empty())
45+
if (!ExpectedEncoded.empty()) {
4546
ASSERT_EQ(ActualEncoded, ExpectedEncoded)
4647
<< "Encoding " << testing::PrintToString(Locs);
48+
}
4749
}
4850
std::vector<SourceLocation::UIntTy> DecodedEncoded;
4951
{
@@ -70,7 +72,7 @@ TEST(SourceLocationEncoding, Individual) {
7072
roundTrip(Big);
7173
roundTrip(Big + 1);
7274
roundTrip(MacroBit | Big);
73-
roundTrip(MacroBit | Big + 1);
75+
roundTrip(MacroBit | (Big + 1));
7476
}
7577

7678
TEST(SourceLocationEncoding, Sequence) {

0 commit comments

Comments
 (0)