//===- unittests/Serialization/SourceLocationEncodingTests.cpp ------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "clang/Serialization/SourceLocationEncoding.h" #include "gtest/gtest.h" #include <climits> #include <optional> usingnamespacellvm; usingnamespaceclang; namespace { LocSeq; // Convert a single source location into encoded form and back. // If ExpectedEncoded is provided, verify the encoded value too. // Loc is the raw (in-memory) form of SourceLocation. void roundTrip(SourceLocation::UIntTy Loc, std::optional<uint64_t> ExpectedEncoded = std::nullopt) { … } // As above, but use sequence encoding for a series of locations. void roundTrip(std::vector<SourceLocation::UIntTy> Locs, std::vector<uint64_t> ExpectedEncoded = { … } constexpr SourceLocation::UIntTy MacroBit = …; constexpr SourceLocation::UIntTy Big = …; constexpr SourceLocation::UIntTy Biggest = …; TEST(SourceLocationEncoding, Individual) { … } TEST(SourceLocationEncoding, Sequence) { … } } // namespace