summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2017-06-23 21:45:29 +0000
committerLang Hames <lhames@gmail.com>2017-06-23 21:45:29 +0000
commit2c19c1be56e7b365cb893003ca896755ac3ddfff (patch)
tree7355e91987c626b585d20b2b584ed12f9a59afa3 /llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
parent36206206cdb20b17f8cf80b10b483af6efd4880e (diff)
downloadbcm5719-llvm-2c19c1be56e7b365cb893003ca896755ac3ddfff.tar.gz
bcm5719-llvm-2c19c1be56e7b365cb893003ca896755ac3ddfff.zip
[ORC] Move ORC IR layer interface from addModuleSet to addModule and fix the
module type as std::shared_ptr<Module>. llvm-svn: 306166
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