Skip to content

Commit 55df4a1

Browse files
committed
Fix tests
1 parent 09d4fd3 commit 55df4a1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/unittests/Serialization/SourceLocationEncodingTest.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ void roundTrip(SourceLocation::UIntTy Loc,
3434
ASSERT_EQ(DecodedEncoded, Loc) << "Decoding " << ActualEncoded;
3535
}
3636

37-
constexpr SourceLocation::UIntTy MacroBit =
38-
1 << (sizeof(SourceLocation::UIntTy) * CHAR_BIT - 1);
39-
constexpr SourceLocation::UIntTy Big = MacroBit >> 1;
37+
constexpr SourceLocation::UIntTy MacroBit = 1ull << (SourceLocation::Bits - 1);
38+
constexpr SourceLocation::UIntTy Big = 1ull << (SourceLocation::Bits - 2);
39+
constexpr SourceLocation::UIntTy Biggest =
40+
llvm::maskTrailingOnes<uint64_t>(SourceLocation::Bits - 1);
4041

4142
TEST(SourceLocationEncoding, Individual) {
4243
roundTrip(1, 2);

0 commit comments

Comments
 (0)