[PATCH] D139015: [Threading] Ensure Tests Reflect Disabled Threads

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 07:41:13 PST 2022


lenary created this revision.
Herald added a project: All.
lenary requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

D137836 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139015

Files:
  llvm/unittests/Support/Threading.cpp


Index: llvm/unittests/Support/Threading.cpp
===================================================================
--- llvm/unittests/Support/Threading.cpp
+++ llvm/unittests/Support/Threading.cpp
@@ -20,6 +20,7 @@
 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 @@
          (Host.isX86() && Host.isOSLinux()) ||
          (Host.isOSLinux() && !Host.isAndroid()) ||
          (Host.isSystemZ() && Host.isOSzOS());
+#else
+  return false;
+#endif
 }
 
 TEST(Threading, PhysicalConcurrency) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139015.478952.patch
Type: text/x-patch
Size: 669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221130/c4690887/attachment.bin>


More information about the llvm-commits mailing list