[Orc] Require target support for host before running execution unit tests.

Orc unit tests that execute code shouldn't run if the compiler doesn't have
target support for the host machine.

llvm-svn: 251551
This commit is contained in:
Lang Hames 2015-10-28 20:08:51 +00:00
parent b731b89228
commit 6ac3fe2ab7
1 changed files with 6 additions and 3 deletions

View File

@ -44,12 +44,15 @@ public:
std::unique_ptr<TargetMachine> getHostTargetMachineIfSupported() {
std::unique_ptr<TargetMachine> TM(EngineBuilder().selectTarget());
if (!TM)
return nullptr;
const Triple& TT = TM->getTargetTriple();
if (TT.getArch() == Triple::x86_64 && TT.isOSDarwin())
return TM;
if (TT.getArch() != Triple::x86_64 || !TT.isOSDarwin())
return nullptr;
return nullptr;
return TM;
}
private: