summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2017-06-23 23:25:28 +0000
committerLang Hames <lhames@gmail.com>2017-06-23 23:25:28 +0000
commitcd9d49b605cc0c3283bc6f2ad4c38f8e1a525e7d (patch)
treede5c655184f5e9f11f2af90a3ab42d4ac10b6e1f /llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
parent7aacb659dad5ecdaa984406e0c6cc9a087f44e1b (diff)
downloadbcm5719-llvm-cd9d49b605cc0c3283bc6f2ad4c38f8e1a525e7d.tar.gz
bcm5719-llvm-cd9d49b605cc0c3283bc6f2ad4c38f8e1a525e7d.zip
[ORC] Re-apply r306166 and r306168 with fix for regression test.
llvm-svn: 306182
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
index e8ba16a472b..2900a9c9276 100644
--- a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
@@ -65,8 +65,9 @@ protected:
CompileContext *CCtx = static_cast<CompileContext*>(Ctx);
auto *ET = CCtx->APIExecTest;
CCtx->M = ET->createTestModule(ET->TM->getTargetTriple());
- CCtx->H = LLVMOrcAddEagerlyCompiledIR(JITStack, wrap(CCtx->M.get()),
- myResolver, nullptr);
+ LLVMSharedModuleRef SM = LLVMOrcMakeSharedModule(wrap(CCtx->M.release()));
+ CCtx->H = LLVMOrcAddEagerlyCompiledIR(JITStack, SM, myResolver, nullptr);
+ LLVMOrcDisposeSharedModuleRef(SM);
CCtx->Compiled = true;
LLVMOrcTargetAddress MainAddr = LLVMOrcGetSymbolAddress(JITStack, "main");
LLVMOrcSetIndirectStubPointer(JITStack, "foo", MainAddr);
@@ -87,8 +88,10 @@ TEST_F(OrcCAPIExecutionTest, TestEagerIRCompilation) {
LLVMOrcGetMangledSymbol(JIT, &testFuncName, "testFunc");
+ LLVMSharedModuleRef SM = LLVMOrcMakeSharedModule(wrap(M.release()));
LLVMOrcModuleHandle H =
- LLVMOrcAddEagerlyCompiledIR(JIT, wrap(M.get()), myResolver, nullptr);
+ LLVMOrcAddEagerlyCompiledIR(JIT, SM, myResolver, nullptr);
+ LLVMOrcDisposeSharedModuleRef(SM);
MainFnTy MainFn = (MainFnTy)LLVMOrcGetSymbolAddress(JIT, "main");
int Result = MainFn();
EXPECT_EQ(Result, 42)
@@ -111,8 +114,10 @@ TEST_F(OrcCAPIExecutionTest, TestLazyIRCompilation) {
LLVMOrcGetMangledSymbol(JIT, &testFuncName, "testFunc");
+ LLVMSharedModuleRef SM = LLVMOrcMakeSharedModule(wrap(M.release()));
LLVMOrcModuleHandle H =
- LLVMOrcAddLazilyCompiledIR(JIT, wrap(M.get()), myResolver, nullptr);
+ LLVMOrcAddLazilyCompiledIR(JIT, SM, myResolver, nullptr);
+ LLVMOrcDisposeSharedModuleRef(SM);
MainFnTy MainFn = (MainFnTy)LLVMOrcGetSymbolAddress(JIT, "main");
int Result = MainFn();
EXPECT_EQ(Result, 42)
OpenPOWER on IntegriCloud