[ORC] Call ExecutorProcessControl::disconnect in unit tests that require it.
authorLang Hames <lhames@gmail.com>
Tue, 12 Oct 2021 21:55:49 +0000 (14:55 -0700)
committerLang Hames <lhames@gmail.com>
Tue, 12 Oct 2021 21:59:39 +0000 (14:59 -0700)
Another follow-up to 2815ed57e3c and 19b4e3cfc6a. For unit tests that don't use
an ExecutionSession we need to call ExecutorProcessControl::disconnect directly
to wait for the dispatcher to shut down.

https://llvm.org/PR52153

llvm/unittests/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManagerTest.cpp
llvm/unittests/ExecutionEngine/Orc/EPCGenericMemoryAccessTest.cpp

index f2b157e..a95435a 100644 (file)
@@ -134,6 +134,8 @@ TEST(EPCGenericJITLinkMemoryManagerTest, AllocFinalizeFree) {
 
   auto Err2 = MemMgr->deallocate(std::move(*FA));
   EXPECT_THAT_ERROR(std::move(Err2), Succeeded());
+
+  cantFail(SelfEPC->disconnect());
 }
 
 } // namespace
index 7802464..beb0fef 100644 (file)
@@ -93,6 +93,8 @@ TEST(EPCGenericMemoryAccessTest, MemWrites) {
       {{pointerToJITTargetAddress(&Test_Buffer), TestMsg}});
   EXPECT_THAT_ERROR(std::move(Err5), Succeeded());
   EXPECT_EQ(StringRef(Test_Buffer, TestMsg.size()), TestMsg);
+
+  cantFail(SelfEPC->disconnect());
 }
 
 } // namespace