summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp60
-rw-r--r--unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp12
-rw-r--r--unittests/ExecutionEngine/MCJIT/MCJITTest.cpp10
3 files changed, 41 insertions, 41 deletions
diff --git a/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
index 7c3239ea259..62ed0a8cb11 100644
--- a/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
+++ b/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
@@ -94,8 +94,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_case) {
Function *FA, *FB;
createTwoModuleCase(A, FA, B, FB);
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str());
checkAdd(ptr);
@@ -114,8 +114,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_reverse_case) {
Function *FA, *FB;
createTwoModuleCase(A, FA, B, FB);
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t ptr = TheJIT->getFunctionAddress(FB->getName().str());
TheJIT->finalizeObject();
@@ -135,8 +135,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_extern_reverse_case) {
Function *FA, *FB;
createTwoModuleExternCase(A, FA, B, FB);
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t ptr = TheJIT->getFunctionAddress(FB->getName().str());
TheJIT->finalizeObject();
@@ -156,8 +156,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_extern_case) {
Function *FA, *FB;
createTwoModuleExternCase(A, FA, B, FB);
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str());
checkAdd(ptr);
@@ -177,8 +177,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_consecutive_call_case) {
createTwoModuleExternCase(A, FA1, B, FB);
FA2 = insertSimpleCallFunction<int32_t(int32_t, int32_t)>(A.get(), FA1);
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t ptr = TheJIT->getFunctionAddress(FB->getName().str());
TheJIT->finalizeObject();
@@ -213,8 +213,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_global_variables_case) {
FB = startFunction<int32_t(void)>(B.get(), "FB");
endFunctionWithRet(FB, Builder.CreateLoad(GVB));
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t FBPtr = TheJIT->getFunctionAddress(FB->getName().str());
TheJIT->finalizeObject();
@@ -241,9 +241,9 @@ TEST_F(MCJITMultipleModuleTest, three_module_case) {
Function *FA, *FB, *FC;
createThreeModuleCase(A, FA, B, FB, C, FC);
- createJIT(A.take());
- TheJIT->addModule(B.take());
- TheJIT->addModule(C.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
+ TheJIT->addModule(C.release());
uint64_t ptr = TheJIT->getFunctionAddress(FC->getName().str());
checkAdd(ptr);
@@ -266,9 +266,9 @@ TEST_F(MCJITMultipleModuleTest, three_module_case_reverse_order) {
Function *FA, *FB, *FC;
createThreeModuleCase(A, FA, B, FB, C, FC);
- createJIT(A.take());
- TheJIT->addModule(B.take());
- TheJIT->addModule(C.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
+ TheJIT->addModule(C.release());
uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str());
checkAdd(ptr);
@@ -291,9 +291,9 @@ TEST_F(MCJITMultipleModuleTest, three_module_chain_case) {
Function *FA, *FB, *FC;
createThreeModuleChainedCallsCase(A, FA, B, FB, C, FC);
- createJIT(A.take());
- TheJIT->addModule(B.take());
- TheJIT->addModule(C.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
+ TheJIT->addModule(C.release());
uint64_t ptr = TheJIT->getFunctionAddress(FC->getName().str());
checkAdd(ptr);
@@ -316,9 +316,9 @@ TEST_F(MCJITMultipleModuleTest, three_modules_chain_case_reverse_order) {
Function *FA, *FB, *FC;
createThreeModuleChainedCallsCase(A, FA, B, FB, C, FC);
- createJIT(A.take());
- TheJIT->addModule(B.take());
- TheJIT->addModule(C.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
+ TheJIT->addModule(C.release());
uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str());
checkAdd(ptr);
@@ -341,8 +341,8 @@ TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case) {
Function *FA, *FB1, *FB2;
createCrossModuleRecursiveCase(A, FA, B, FB1, FB2);
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str());
checkAccumulate(ptr);
@@ -362,8 +362,8 @@ TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case_reverse_order) {
Function *FA, *FB1, *FB2;
createCrossModuleRecursiveCase(A, FA, B, FB1, FB2);
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t ptr = TheJIT->getFunctionAddress(FB1->getName().str());
checkAccumulate(ptr);
@@ -383,8 +383,8 @@ TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case3) {
Function *FA, *FB1, *FB2;
createCrossModuleRecursiveCase(A, FA, B, FB1, FB2);
- createJIT(A.take());
- TheJIT->addModule(B.take());
+ createJIT(A.release());
+ TheJIT->addModule(B.release());
uint64_t ptr = TheJIT->getFunctionAddress(FB1->getName().str());
checkAccumulate(ptr);
diff --git a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
index ba7f933671a..f16928b7a96 100644
--- a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
+++ b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
@@ -122,7 +122,7 @@ protected:
TEST_F(MCJITObjectCacheTest, SetNullObjectCache) {
SKIP_UNSUPPORTED_PLATFORM;
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(NULL);
@@ -138,7 +138,7 @@ TEST_F(MCJITObjectCacheTest, VerifyBasicObjectCaching) {
// Save a copy of the module pointer before handing it off to MCJIT.
const Module * SavedModulePointer = M.get();
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
@@ -165,7 +165,7 @@ TEST_F(MCJITObjectCacheTest, VerifyLoadFromCache) {
OwningPtr<TestObjectCache> Cache(new TestObjectCache);
// Compile this module with an MCJIT engine
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
TheJIT->finalizeObject();
@@ -182,7 +182,7 @@ TEST_F(MCJITObjectCacheTest, VerifyLoadFromCache) {
const Module * SecondModulePointer = M.get();
// Create a new MCJIT instance to load this module then execute it.
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
compileAndRun();
@@ -199,7 +199,7 @@ TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) {
OwningPtr<TestObjectCache> Cache(new TestObjectCache);
// Compile this module with an MCJIT engine
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
TheJIT->finalizeObject();
@@ -217,7 +217,7 @@ TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) {
const Module * SecondModulePointer = M.get();
// Create a new MCJIT instance to load this module then execute it.
- createJIT(M.take());
+ createJIT(M.release());
TheJIT->setObjectCache(Cache.get());
// Verify that our object cache does not contain the module yet.
diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
index fab81551fa5..a439508af0c 100644
--- a/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
+++ b/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp
@@ -49,7 +49,7 @@ TEST_F(MCJITTest, global_variable) {
int initialValue = 5;
GlobalValue *Global = insertGlobalInt32(M.get(), "test_global", initialValue);
- createJIT(M.take());
+ createJIT(M.release());
void *globalPtr = TheJIT->getPointerToGlobal(Global);
EXPECT_TRUE(0 != globalPtr)
<< "Unable to get pointer to global value from JIT";
@@ -62,7 +62,7 @@ TEST_F(MCJITTest, add_function) {
SKIP_UNSUPPORTED_PLATFORM;
Function *F = insertAddFunction(M.get());
- createJIT(M.take());
+ createJIT(M.release());
uint64_t addPtr = TheJIT->getFunctionAddress(F->getName().str());
EXPECT_TRUE(0 != addPtr)
<< "Unable to get pointer to function from JIT";
@@ -83,7 +83,7 @@ TEST_F(MCJITTest, run_main) {
int rc = 6;
Function *Main = insertMainFunction(M.get(), 6);
- createJIT(M.take());
+ createJIT(M.release());
uint64_t ptr = TheJIT->getFunctionAddress(Main->getName().str());
EXPECT_TRUE(0 != ptr)
<< "Unable to get pointer to main() from JIT";
@@ -104,7 +104,7 @@ TEST_F(MCJITTest, return_global) {
Value *ReadGlobal = Builder.CreateLoad(GV);
endFunctionWithRet(ReturnGlobal, ReadGlobal);
- createJIT(M.take());
+ createJIT(M.release());
uint64_t rgvPtr = TheJIT->getFunctionAddress(ReturnGlobal->getName().str());
EXPECT_TRUE(0 != rgvPtr);
@@ -175,7 +175,7 @@ TEST_F(MCJITTest, multiple_functions) {
Inner = Outer;
}
- createJIT(M.take());
+ createJIT(M.release());
uint64_t ptr = TheJIT->getFunctionAddress(Outer->getName().str());
EXPECT_TRUE(0 != ptr)
<< "Unable to get pointer to outer function from JIT";