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