@@ -20,7 +20,7 @@ class LLVMExecutableCodeTest : public testing::Test
2020 {
2121 m_module = std::make_unique<llvm::Module>(" test" , m_ctx);
2222 m_builder = std::make_unique<llvm::IRBuilder<>>(m_ctx);
23- test_function (nullptr , nullptr , nullptr , nullptr ); // force dependency
23+ test_function (nullptr , nullptr , nullptr , nullptr , nullptr ); // force dependency
2424
2525 llvm::InitializeNativeTarget ();
2626 llvm::InitializeNativeTargetAsmPrinter ();
@@ -31,9 +31,9 @@ class LLVMExecutableCodeTest : public testing::Test
3131
3232 llvm::Function *beginMainFunction ()
3333 {
34- // void *f(Target *, ValueData **, List **)
34+ // void *f(ExecutionContext *, Target *, ValueData **, List **)
3535 llvm::Type *pointerType = llvm::PointerType::get (llvm::Type::getInt8Ty (m_ctx), 0 );
36- llvm::FunctionType *funcType = llvm::FunctionType::get (pointerType, { pointerType, pointerType, pointerType }, false );
36+ llvm::FunctionType *funcType = llvm::FunctionType::get (pointerType, { pointerType, pointerType, pointerType, pointerType }, false );
3737 llvm::Function *func = llvm::Function::Create (funcType, llvm::Function::ExternalLinkage, " f" , m_module.get ());
3838
3939 llvm::BasicBlock *entry = llvm::BasicBlock::Create (m_ctx, " entry" , func);
@@ -57,12 +57,12 @@ class LLVMExecutableCodeTest : public testing::Test
5757 void addTestFunction (llvm::Function *mainFunc)
5858 {
5959 auto ptrType = llvm::PointerType::get (llvm::Type::getInt8Ty (m_ctx), 0 );
60- auto func = m_module->getOrInsertFunction (" test_function" , llvm::FunctionType::get (m_builder->getVoidTy (), { ptrType, ptrType, ptrType, ptrType }, false ));
60+ auto func = m_module->getOrInsertFunction (" test_function" , llvm::FunctionType::get (m_builder->getVoidTy (), { ptrType, ptrType, ptrType, ptrType, ptrType }, false ));
6161
6262 llvm::Constant *mockInt = llvm::ConstantInt::get (llvm::Type::getInt64Ty (m_ctx), (uintptr_t )&m_mock, false );
6363 llvm::Constant *mockPtr = llvm::ConstantExpr::getIntToPtr (mockInt, ptrType);
6464
65- m_builder->CreateCall (func, { mockPtr, mainFunc->getArg (0 ), mainFunc->getArg (1 ), mainFunc->getArg (2 ) });
65+ m_builder->CreateCall (func, { mockPtr, mainFunc->getArg (0 ), mainFunc->getArg (1 ), mainFunc->getArg (2 ), mainFunc-> getArg ( 3 ) });
6666 }
6767
6868 void addTestPrintFunction (llvm::Value *arg1, llvm::Value *arg2)
@@ -110,7 +110,7 @@ TEST_F(LLVMExecutableCodeTest, MainFunction)
110110 auto ctx = code.createExecutionContext (&m_target);
111111 ASSERT_FALSE (code.isFinished (ctx.get ()));
112112
113- EXPECT_CALL (m_mock, f (&m_target, m_target.variableData (), m_target.listData ()));
113+ EXPECT_CALL (m_mock, f (ctx. get (), &m_target, m_target.variableData (), m_target.listData ()));
114114 code.run (ctx.get ());
115115 ASSERT_TRUE (code.isFinished (ctx.get ()));
116116
@@ -135,7 +135,7 @@ TEST_F(LLVMExecutableCodeTest, MainFunction)
135135 ASSERT_FALSE (code.isFinished (anotherCtx.get ()));
136136 ASSERT_TRUE (code.isFinished (ctx.get ()));
137137
138- EXPECT_CALL (m_mock, f (&anotherTarget, anotherTarget.variableData (), anotherTarget.listData ()));
138+ EXPECT_CALL (m_mock, f (anotherCtx. get (), &anotherTarget, anotherTarget.variableData (), anotherTarget.listData ()));
139139 code.run (anotherCtx.get ());
140140 ASSERT_TRUE (code.isFinished (anotherCtx.get ()));
141141 ASSERT_TRUE (code.isFinished (ctx.get ()));
0 commit comments