From 442c61dd9aee54a00248d1540119d407aba07a42 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 31 Mar 2014 23:42:23 +0000 Subject: MCJIT: ensure that cygwin is identified properly Cygwin is now a proper environment rather than an OS. This updates the MCJIT tests to avoid execution on Cygwin. This fixes native cygwin tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205266 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp | 2 ++ unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h | 10 ++++++++-- unittests/ExecutionEngine/MCJIT/MCJITTestBase.h | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp index 092213277d..3813d59dbd 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp @@ -135,6 +135,8 @@ protected: // The operating systems below are known to be sufficiently incompatible // that they will fail the MCJIT C API tests. UnsupportedOSs.push_back(Triple::Cygwin); + + UnsupportedEnvironments.push_back(Triple::Cygnus); } virtual void SetUp() { diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h b/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h index 7b6e39fb23..a48c0713f9 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h +++ b/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h @@ -71,10 +71,15 @@ protected: /// Returns true if the host OS is known to support MCJIT bool OSSupportsMCJIT() { Triple Host(HostTriple); + + if (std::find(UnsupportedEnvironments.begin(), UnsupportedEnvironments.end(), + Host.getEnvironment()) != UnsupportedEnvironments.end()) + return false; + if (std::find(UnsupportedOSs.begin(), UnsupportedOSs.end(), Host.getOS()) - == UnsupportedOSs.end()) { + == UnsupportedOSs.end()) return true; - } + return false; } @@ -83,6 +88,7 @@ protected: SmallVector HasSubArchs; SmallVector SupportedSubArchs; // We need to own the memory SmallVector UnsupportedOSs; + SmallVector UnsupportedEnvironments; }; } // namespace llvm diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h index b2cb3bbef6..25de312e0e 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h +++ b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h @@ -304,6 +304,8 @@ protected: // should be kept in sync. UnsupportedOSs.push_back(Triple::Cygwin); UnsupportedOSs.push_back(Triple::Darwin); + + UnsupportedEnvironments.push_back(Triple::Cygnus); } void createJIT(Module *M) { -- cgit v1.2.3