From 7b75a3a8ebf04b321e07f17aac5bfe9cb7c656d1 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Sat, 17 Apr 2021 13:56:23 -0400 Subject: [PATCH] [Support] ThreadPool tests: silence warning unused variable 'It' --- llvm/unittests/Support/ThreadPool.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/unittests/Support/ThreadPool.cpp b/llvm/unittests/Support/ThreadPool.cpp index 30a8924d16c4b..a560d5069bff9 100644 --- a/llvm/unittests/Support/ThreadPool.cpp +++ b/llvm/unittests/Support/ThreadPool.cpp @@ -246,8 +246,10 @@ TEST_F(ThreadPoolTest, AffinityMask) { // Ensure the threads only ran on CPUs 0-3. // NOTE: Don't use ASSERT* here because this runs in a subprocess, // and will show up as un-executed in the parent. - for (auto &It : ThreadsUsed) - assert(It.getData().front() < 16UL); + assert(llvm::all_of(ThreadsUsed, + [](auto &T) { return T.getData().front() < 16UL; }) && + "Threads ran on more CPUs than expected! The affinity mask does not " + "seem to work."); return; } std::string Executable =