forked from OSchip/llvm-project
[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:
parent
b731b89228
commit
6ac3fe2ab7
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue