[llvm] r251551 - [Orc] Require target support for host before running execution unit tests.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 28 13:08:52 PDT 2015
Author: lhames
Date: Wed Oct 28 15:08:51 2015
New Revision: 251551
URL: http://llvm.org/viewvc/llvm-project?rev=251551&view=rev
Log:
[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.
Modified:
llvm/trunk/unittests/ExecutionEngine/Orc/OrcTestCommon.h
Modified: llvm/trunk/unittests/ExecutionEngine/Orc/OrcTestCommon.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/OrcTestCommon.h?rev=251551&r1=251550&r2=251551&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/Orc/OrcTestCommon.h (original)
+++ llvm/trunk/unittests/ExecutionEngine/Orc/OrcTestCommon.h Wed Oct 28 15:08:51 2015
@@ -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:
More information about the llvm-commits
mailing list