@@ -146,6 +146,33 @@ TEST(InterpreterTest, Process) {
146
146
clang_Interpreter_dispose (CXI);
147
147
}
148
148
149
+ #ifdef CPPINTEROP_WITH_OOP_JIT
150
+ TEST (InterpreterTest, OopJITProcess) {
151
+ #ifdef _WIN32
152
+ GTEST_SKIP () << " Disabled on Windows. Needs fixing." ;
153
+ #endif
154
+ if (llvm::sys::RunningOnValgrind ())
155
+ GTEST_SKIP () << " XFAIL due to Valgrind report" ;
156
+ std::vector<const char *> interpreter_args = { " -include" , " new" };
157
+ auto * I = Cpp::CreateInterpreter (interpreter_args, {}, true );
158
+ EXPECT_TRUE (Cpp::Process (" " ) == 0 );
159
+ EXPECT_TRUE (Cpp::Process (" int a = 12;" ) == 0 );
160
+ EXPECT_FALSE (Cpp::Process (" error_here;" ) == 0 );
161
+ // Linker/JIT error.
162
+ EXPECT_FALSE (Cpp::Process (" int f(); int res = f();" ) == 0 );
163
+
164
+ // C API
165
+ auto * CXI = clang_createInterpreterFromRawPtr (I);
166
+ clang_Interpreter_declare (CXI, " #include <iostream>" , false );
167
+ clang_Interpreter_process (CXI, " int c = 42;" );
168
+ auto * CXV = clang_createValue ();
169
+ auto Res = clang_Interpreter_evaluate (CXI, " c" , CXV);
170
+ EXPECT_EQ (Res, CXError_Success);
171
+ clang_Value_dispose (CXV);
172
+ clang_Interpreter_dispose (CXI);
173
+ }
174
+ #endif
175
+
149
176
TEST (InterpreterTest, EmscriptenExceptionHandling) {
150
177
#ifndef EMSCRIPTEN
151
178
GTEST_SKIP () << " This test is intended to check exception handling for Emscripten builds." ;
0 commit comments