From: NAKAMURA Takumi Date: Tue, 6 Oct 2015 13:58:13 +0000 (+0000) Subject: ToolingTests: Tweak getAnyTarget() to match "x86_64". X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66a002078453fd34727f121f747fd4961f48a776;p=clang ToolingTests: Tweak getAnyTarget() to match "x86_64". Both "x86" and "x86-64" are incompatible to triple's arch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249403 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Tooling/ToolingTest.cpp b/unittests/Tooling/ToolingTest.cpp index 73d771f939..e479af828a 100644 --- a/unittests/Tooling/ToolingTest.cpp +++ b/unittests/Tooling/ToolingTest.cpp @@ -301,9 +301,11 @@ std::string getAnyTarget() { llvm::InitializeAllTargets(); for (const auto &Target : llvm::TargetRegistry::targets()) { std::string Error; - if (llvm::TargetRegistry::lookupTarget(Target.getName(), Error) == - &Target) { - return Target.getName(); + StringRef TargetName(Target.getName()); + if (TargetName == "x86-64") + TargetName = "x86_64"; + if (llvm::TargetRegistry::lookupTarget(TargetName, Error) == &Target) { + return TargetName; } } return "";