MCJIT: ensure that cygwin is identified properly
authorSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 31 Mar 2014 23:42:23 +0000 (23:42 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 31 Mar 2014 23:42:23 +0000 (23:42 +0000)
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
unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
unittests/ExecutionEngine/MCJIT/MCJITTestBase.h

index 092213277d1cea46fc10b2102394024922b7bff0..3813d59dbd1195cb0361fe98122cfc68c72a1ce4 100644 (file)
@@ -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() {
index 7b6e39fb23854f33aeae0c4475561ea171392dde..a48c0713f9b86e7b83defec22126a618ae60f9a6 100644 (file)
@@ -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<Triple::ArchType, 1> HasSubArchs;
   SmallVector<std::string, 2> SupportedSubArchs; // We need to own the memory
   SmallVector<Triple::OSType, 4> UnsupportedOSs;
+  SmallVector<Triple::EnvironmentType, 1> UnsupportedEnvironments;
 };
 
 } // namespace llvm
index b2cb3bbef6e6636e50e2c937fa60c9056adaad8b..25de312e0e87702cfe2d882fd0c7350ba409b80d 100644 (file)
@@ -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) {