From c59ebe4c4c2d125a8a0b788f5af5d4d052d38818 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Sun, 10 Oct 2021 21:09:29 -0700 Subject: [PATCH] [ORC] Add TaskDispatcher::shutdown calls to TaskDispatchTest.cpp unit tests. These calls were left out of 4d7cea3d2e8. In the InPlaceDispatcher test case the operation is a no-op, but it's good form to include it. In the DynamicThreadPoolTaskDispatcher test the shutdown call is required to ensure that we don't exit the test (and tear down the dispatcher) before the thread running the dispatch has completed. --- llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp b/llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp index 60a5e75..83d386c 100644 --- a/llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/TaskDispatchTest.cpp @@ -19,6 +19,7 @@ TEST(InPlaceTaskDispatchTest, GenericNamedTask) { bool B = false; D->dispatch(makeGenericNamedTask([&]() { B = true; })); EXPECT_TRUE(B); + D->shutdown(); } #if LLVM_ENABLE_THREADS @@ -29,5 +30,6 @@ TEST(DynamicThreadPoolDispatchTest, GenericNamedTask) { D->dispatch(makeGenericNamedTask( [P = std::move(P)]() mutable { P.set_value(true); })); EXPECT_TRUE(F.get()); + D->shutdown(); } #endif -- 2.7.4