[llvm] cb36bfa - Fix 01b02a73de78 to use correct macro spelling and fix unit tests.

Amy Huang via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 15:58:49 PST 2020


Author: Amy Huang
Date: 2020-02-14T15:58:36-08:00
New Revision: cb36bfa3de3ecba0e30de766999243eb72360533

URL: https://github.com/llvm/llvm-project/commit/cb36bfa3de3ecba0e30de766999243eb72360533
DIFF: https://github.com/llvm/llvm-project/commit/cb36bfa3de3ecba0e30de766999243eb72360533.diff

LOG: Fix 01b02a73de78 to use correct macro spelling and fix unit tests.

Added: 
    

Modified: 
    llvm/lib/Support/Host.cpp
    llvm/unittests/Support/Host.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index 371271e6bae1..cafdc2ff380c 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -1326,7 +1326,7 @@ int computeHostNumPhysicalCores() {
   }
   return count;
 }
-#elif defined(_WIN32) && LLVM_THREADS_ENABLED
+#elif defined(_WIN32) && LLVM_ENABLE_THREADS != 0
 // Defined in llvm/lib/Support/Windows/Threading.inc
 int computeHostNumPhysicalCores();
 #else

diff  --git a/llvm/unittests/Support/Host.cpp b/llvm/unittests/Support/Host.cpp
index 62252347d62a..e5c28167f4d4 100644
--- a/llvm/unittests/Support/Host.cpp
+++ b/llvm/unittests/Support/Host.cpp
@@ -13,6 +13,7 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Program.h"
+#include "llvm/Support/Threading.h"
 
 #include "gtest/gtest.h"
 
@@ -37,7 +38,7 @@ class HostTest : public testing::Test {
     // Initially this is only testing detection of the number of
     // physical cores, which is currently only supported/tested for
     // x86_64 Linux and Darwin.
-    return Host.isOSWindows() ||
+    return (Host.isOSWindows() && llvm_is_multithreaded()) ||
            (Host.getArch() == Triple::x86_64 &&
             (Host.isOSDarwin() || Host.getOS() == Triple::Linux));
   }


        


More information about the llvm-commits mailing list