Skip to content

Commit 0940f68

Browse files
authored
Move static test variable into the #if that uses it (llvm#169695)
Fixes -Wunused-variable when compiling without LLVM_ENABLE_THREADS
1 parent 411a53e commit 0940f68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/unittests/Support/JobserverTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ extern const char *TestMainArgv0;
4646

4747
namespace {
4848

49-
// Unique anchor whose address helps locate the current test binary.
50-
static int JobserverTestAnchor = 0;
51-
5249
// RAII helper to set an environment variable for the duration of a test.
5350
class ScopedEnvironment {
5451
std::string Name;
@@ -225,6 +222,9 @@ TEST_F(JobserverClientTest, UnixClientFifo) {
225222
}
226223

227224
#if LLVM_ENABLE_THREADS
225+
// Unique anchor whose address helps locate the current test binary.
226+
static int JobserverTestAnchor = 0;
227+
228228
// Test fixture for tests that use the jobserver strategy. It creates a
229229
// temporary FIFO, sets MAKEFLAGS, and provides a helper to pre-load the FIFO
230230
// with job tokens, simulating `make -jN`.

0 commit comments

Comments
 (0)