From: Archibald Elliott Date: Wed, 30 Nov 2022 15:18:14 +0000 (+0000) Subject: [Threading] Ensure Tests Reflect Disabled Threads X-Git-Tag: upstream/17.0.6~25853 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02efd7d2716ae56ccf3ca0a62b84bb487e8a1221;p=platform%2Fupstream%2Fllvm.git [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 --- 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) {