File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -448,3 +448,30 @@ TEST(InterpreterTest, MultipleInterpreter) {
448
448
std::string cerrs = testing::internal::GetCapturedStderr ();
449
449
EXPECT_STREQ (cerrs.c_str (), " printf_jit called!\n " );
450
450
}
451
+
452
+ TEST (InterpreterTest, ASMParsing) {
453
+ #ifdef EMSCRIPTEN
454
+ GTEST_SKIP () << " Test fails for Emscipten builds" ;
455
+ #endif
456
+ #ifdef _WIN32
457
+ GTEST_SKIP () << " Disabled on Windows. Needs fixing." ;
458
+ #endif
459
+ if (llvm::sys::RunningOnValgrind ())
460
+ GTEST_SKIP () << " XFAIL due to Valgrind report" ;
461
+ std::vector<const char *> interpreter_args = {" -include" , " new" };
462
+ auto * I = Cpp::CreateInterpreter (interpreter_args);
463
+ EXPECT_TRUE (I);
464
+
465
+ EXPECT_TRUE (Cpp::Declare (R"(
466
+ #include <iostream>
467
+ void foo(int &input) {
468
+ __asm__ volatile ("addl $10, %0" : "+r"(input));
469
+ }
470
+ )" ,
471
+ I) == 0 );
472
+
473
+ bool hasError;
474
+ EXPECT_TRUE (Cpp::Process (" int b = 42; foo(b);" ) == 0 );
475
+ EXPECT_TRUE (Cpp::Evaluate (" b" , &hasError) == 52 );
476
+ EXPECT_FALSE (hasError);
477
+ }
You can’t perform that action at this time.
0 commit comments