diff options
Diffstat (limited to 'llvm/unittests/TextAPI')
-rw-r--r-- | llvm/unittests/TextAPI/TextStubV1Tests.cpp | 19 | ||||
-rw-r--r-- | llvm/unittests/TextAPI/TextStubV2Tests.cpp | 19 |
2 files changed, 30 insertions, 8 deletions
diff --git a/llvm/unittests/TextAPI/TextStubV1Tests.cpp b/llvm/unittests/TextAPI/TextStubV1Tests.cpp index 65e9c042fad..d68361d65af 100644 --- a/llvm/unittests/TextAPI/TextStubV1Tests.cpp +++ b/llvm/unittests/TextAPI/TextStubV1Tests.cpp @@ -16,11 +16,21 @@ using namespace llvm; using namespace llvm::MachO; -using ExportedSymbol = std::tuple<SymbolKind, std::string, bool, bool>; +struct ExportedSymbol { + SymbolKind Kind; + std::string Name; + bool WeakDefined; + bool ThreadLocalValue; +}; using ExportedSymbolSeq = std::vector<ExportedSymbol>; inline bool operator<(const ExportedSymbol &lhs, const ExportedSymbol &rhs) { - return std::get<1>(lhs) < std::get<1>(rhs); + return std::tie(lhs.Kind, lhs.Name) < std::tie(rhs.Kind, rhs.Name); +} + +inline bool operator==(const ExportedSymbol &lhs, const ExportedSymbol &rhs) { + return std::tie(lhs.Kind, lhs.Name, lhs.WeakDefined, lhs.ThreadLocalValue) == + std::tie(rhs.Kind, rhs.Name, rhs.WeakDefined, rhs.ThreadLocalValue); } static ExportedSymbol TBDv1Symbols[] = { @@ -100,8 +110,9 @@ TEST(TBDv1, ReadFile) { for (const auto *Sym : File->symbols()) { EXPECT_FALSE(Sym->isWeakReferenced()); EXPECT_FALSE(Sym->isUndefined()); - Exports.emplace_back(Sym->getKind(), Sym->getName(), Sym->isWeakDefined(), - Sym->isThreadLocalValue()); + Exports.emplace_back(ExportedSymbol{Sym->getKind(), Sym->getName(), + Sym->isWeakDefined(), + Sym->isThreadLocalValue()}); } llvm::sort(Exports.begin(), Exports.end()); diff --git a/llvm/unittests/TextAPI/TextStubV2Tests.cpp b/llvm/unittests/TextAPI/TextStubV2Tests.cpp index 79d6cac8938..62032422dd7 100644 --- a/llvm/unittests/TextAPI/TextStubV2Tests.cpp +++ b/llvm/unittests/TextAPI/TextStubV2Tests.cpp @@ -16,11 +16,21 @@ using namespace llvm; using namespace llvm::MachO; -using ExportedSymbol = std::tuple<SymbolKind, std::string, bool, bool>; +struct ExportedSymbol { + SymbolKind Kind; + std::string Name; + bool WeakDefined; + bool ThreadLocalValue; +}; using ExportedSymbolSeq = std::vector<ExportedSymbol>; inline bool operator<(const ExportedSymbol &lhs, const ExportedSymbol &rhs) { - return std::get<1>(lhs) < std::get<1>(rhs); + return std::tie(lhs.Kind, lhs.Name) < std::tie(rhs.Kind, rhs.Name); +} + +inline bool operator==(const ExportedSymbol &lhs, const ExportedSymbol &rhs) { + return std::tie(lhs.Kind, lhs.Name, lhs.WeakDefined, lhs.ThreadLocalValue) == + std::tie(rhs.Kind, rhs.Name, rhs.WeakDefined, rhs.ThreadLocalValue); } static ExportedSymbol TBDv2Symbols[] = { @@ -102,8 +112,9 @@ TEST(TBDv2, ReadFile) { for (const auto *Sym : File->symbols()) { EXPECT_FALSE(Sym->isWeakReferenced()); EXPECT_FALSE(Sym->isUndefined()); - Exports.emplace_back(Sym->getKind(), Sym->getName(), Sym->isWeakDefined(), - Sym->isThreadLocalValue()); + Exports.emplace_back(ExportedSymbol{Sym->getKind(), Sym->getName(), + Sym->isWeakDefined(), + Sym->isThreadLocalValue()}); } llvm::sort(Exports.begin(), Exports.end()); |