11#include " Utils.h"
22
3+ #include " llvm/Support/Valgrind.h"
34#include " clang/AST/ASTContext.h"
45#include " clang/Interpreter/CppInterOp.h"
56#include " clang/Frontend/CompilerInstance.h"
@@ -531,7 +532,8 @@ TEST(FunctionReflectionTest, ExistsFunctionTemplate) {
531532}
532533
533534TEST (FunctionReflectionTest, InstantiateTemplateFunctionFromString) {
534- GTEST_SKIP () << " XFAIL due to Valgrind report" ;
535+ if (llvm::sys::RunningOnValgrind ())
536+ GTEST_SKIP () << " XFAIL due to Valgrind report" ;
535537 Cpp::CreateInterpreter ();
536538 std::string code = R"( #include <memory>)" ;
537539 Interp->process (code);
@@ -733,7 +735,8 @@ TEST(FunctionReflectionTest, IsStaticMethod) {
733735}
734736
735737TEST (FunctionReflectionTest, GetFunctionAddress) {
736- GTEST_SKIP () << " XFAIL due to Valgrind report" ;
738+ if (llvm::sys::RunningOnValgrind ())
739+ GTEST_SKIP () << " XFAIL due to Valgrind report" ;
737740 std::vector<Decl*> Decls, SubDecls;
738741 std::string code = " int f1(int i) { return i * i; }" ;
739742
@@ -773,7 +776,8 @@ TEST(FunctionReflectionTest, IsVirtualMethod) {
773776}
774777
775778TEST (FunctionReflectionTest, JitCallAdvanced) {
776- GTEST_SKIP () << " XFAIL due to Valgrind report" ;
779+ if (llvm::sys::RunningOnValgrind ())
780+ GTEST_SKIP () << " XFAIL due to Valgrind report" ;
777781 std::vector<Decl*> Decls;
778782 std::string code = R"(
779783 typedef struct _name {
@@ -796,7 +800,8 @@ TEST(FunctionReflectionTest, JitCallAdvanced) {
796800
797801
798802TEST (FunctionReflectionTest, GetFunctionCallWrapper) {
799- GTEST_SKIP () << " XFAIL due to Valgrind report" ;
803+ if (llvm::sys::RunningOnValgrind ())
804+ GTEST_SKIP () << " XFAIL due to Valgrind report" ;
800805 std::vector<Decl*> Decls;
801806 std::string code = R"(
802807 int f1(int i) { return i * i; }
@@ -1006,7 +1011,8 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) {
10061011}
10071012
10081013TEST (FunctionReflectionTest, Construct) {
1009- GTEST_SKIP () << " XFAIL due to Valgrind report" ;
1014+ if (llvm::sys::RunningOnValgrind ())
1015+ GTEST_SKIP () << " XFAIL due to Valgrind report" ;
10101016 Cpp::CreateInterpreter ();
10111017
10121018 Interp->declare (R"(
@@ -1041,7 +1047,8 @@ TEST(FunctionReflectionTest, Construct) {
10411047}
10421048
10431049TEST (FunctionReflectionTest, Destruct) {
1044- GTEST_SKIP () << " XFAIL due to Valgrind report" ;
1050+ if (llvm::sys::RunningOnValgrind ())
1051+ GTEST_SKIP () << " XFAIL due to Valgrind report" ;
10451052 Cpp::CreateInterpreter ();
10461053
10471054 Interp->declare (R"(
0 commit comments