From 02efd7d2716ae56ccf3ca0a62b84bb487e8a1221 Mon Sep 17 00:00:00 2001 From: Archibald Elliott Date: Wed, 30 Nov 2022 15:18:14 +0000 Subject: [PATCH] [Threading] Ensure Tests Reflect Disabled Threads D137836 changed what llvm::get_physical_cores returns when threads are disabled, to bring it inline with the other parts of Threading. It now returns the value for "unknown" when threading is disabled. This commit updates the tests (which are failing on some platforms), to also reflect this change. Differential Revision: https://reviews.llvm.org/D139015 --- llvm/unittests/Support/Threading.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/unittests/Support/Threading.cpp b/llvm/unittests/Support/Threading.cpp index daa360e..6ee1821 100644 --- a/llvm/unittests/Support/Threading.cpp +++ b/llvm/unittests/Support/Threading.cpp @@ -20,6 +20,7 @@ using namespace llvm; namespace { static bool isThreadingSupportedArchAndOS() { +#if LLVM_ENABLE_THREADS Triple Host(Triple::normalize(sys::getProcessTriple())); // Initially this is only testing detection of the number of @@ -29,6 +30,9 @@ static bool isThreadingSupportedArchAndOS() { (Host.isX86() && Host.isOSLinux()) || (Host.isOSLinux() && !Host.isAndroid()) || (Host.isSystemZ() && Host.isOSzOS()); +#else + return false; +#endif } TEST(Threading, PhysicalConcurrency) { -- 2.7.4