Skip to content

Commit 39c3fb5

Browse files
committed
Test LLVMExecutableCode with another context
1 parent 994a719 commit 39c3fb5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/dev/llvm/llvmexecutablecode_test.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ TEST_F(LLVMExecutableCodeTest, SingleFunction)
121121
EXPECT_CALL(m_mock, f).Times(0);
122122
code.run(ctx.get());
123123
ASSERT_TRUE(code.isFinished(ctx.get()));
124+
125+
// Test with another context
126+
Target anotherTarget;
127+
auto anotherCtx = code.createExecutionContext(&anotherTarget);
128+
ASSERT_FALSE(code.isFinished(anotherCtx.get()));
129+
ASSERT_TRUE(code.isFinished(ctx.get()));
130+
131+
EXPECT_CALL(m_mock, f(&anotherTarget));
132+
code.run(anotherCtx.get());
133+
ASSERT_TRUE(code.isFinished(anotherCtx.get()));
134+
ASSERT_TRUE(code.isFinished(ctx.get()));
135+
136+
code.reset(ctx.get());
137+
ASSERT_TRUE(code.isFinished(anotherCtx.get()));
138+
ASSERT_FALSE(code.isFinished(ctx.get()));
124139
}
125140

126141
TEST_F(LLVMExecutableCodeTest, MultipleFunctions)

0 commit comments

Comments
 (0)