This part of the LLVM-C API lacked unit tests after OrcJIT v2 was introduced to LLVM-C in LLVM 12.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The test passes with the following changes:
diff --git a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp index 7425f8828fc3..6f00c087f273 100644 --- a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp @@ -121,7 +121,7 @@ TEST_F(OrcCAPITestBase, JITDylibLookup) { TEST_F(OrcCAPITestBase, MaterializationUnitCreation) { LLVMOrcSymbolStringPoolEntryRef Name = - LLVMOrcExecutionSessionIntern(ExecutionSession, "test"); + LLVMOrcLLJITMangleAndIntern(Jit, "test"); LLVMJITSymbolFlags Flags = {LLVMJITSymbolGenericFlagsWeak, 0}; LLVMOrcJITTargetAddress Addr = (LLVMOrcJITTargetAddress)(&materializationUnitFn); @@ -172,13 +172,8 @@ TEST_F(OrcCAPITestBase, ResourceTrackerDefinitionLifetime) { LLVMErrorRef Err = LLVMOrcLLJITLookup(Jit, &OutAddr, "sum"); ASSERT_TRUE(Err); ASSERT_FALSE(OutAddr); - LLVMOrcExecutionSessionRef ES = LLVMOrcLLJITGetExecutionSession(Jit); - // FIXME: Provide a better way of clearing dangling references in - // SymbolStringPool from implicit calls - LLVMOrcSymbolStringPoolEntryRef Name = - LLVMOrcExecutionSessionIntern(ES, "sum"); - LLVMOrcReleaseSymbolStringPoolEntry(Name); - LLVMOrcReleaseSymbolStringPoolEntry(Name); + LLVMOrcReleaseResourceTracker(RT); + LLVMConsumeError(Err); } TEST_F(OrcCAPITestBase, ResourceTrackerTransfer) {
It also helped identify a bug in EHFrameRegistrationPlugin::notifyTransferringResources that was fixed in c1baf946e6c. Nice!
With the changes applied this all looks good to me. If you're happy with everything I'll go ahead and commit on your behalf.