From f7fdc8d0cf7cd5caa7d463e1e80e0d5a08c71bb2 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Fri, 2 May 2025 09:50:34 +0000 Subject: [PATCH] [llvm][Support] Disable runOnNewStack test when threading is disabled On our buildbot https://lab.llvm.org/buildbot/#/builders/122/builds/1478, one of the new tests added by https://github.com/llvm/llvm-project/pull/136046 failed. This is because on non-Apple Silicon platforms, the implementation is to start a new thread, but when threading is disabled this is the same as calling a function normally. --- llvm/unittests/Support/ProgramStackTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/unittests/Support/ProgramStackTest.cpp b/llvm/unittests/Support/ProgramStackTest.cpp index 31dfb3b88ade..2321751c539f 100644 --- a/llvm/unittests/Support/ProgramStackTest.cpp +++ b/llvm/unittests/Support/ProgramStackTest.cpp @@ -12,6 +12,10 @@ using namespace llvm; +// One way of running on a new stack is to start a new thread. When threading +// is disabled a "new thread" is implemented as simply calling the function. +#if LLVM_ENABLE_THREADS + static uintptr_t func(int &A) { A = 7; return getStackPointer(); @@ -33,3 +37,5 @@ TEST(ProgramStackTest, runOnNewStack) { runOnNewStack(0, function_ref(func2), A); EXPECT_EQ(A, 5); } + +#endif /*if LLVM_ENABLE_THREADS */ \ No newline at end of file