Skip to content

Commit 30f4589

Browse files
committed
revert to llvm support for valgrind
1 parent c878019 commit 30f4589

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

unittests/CppInterOp/FunctionReflectionTest.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ TEST(FunctionReflectionTest, ExistsFunctionTemplate) {
531531
}
532532

533533
TEST(FunctionReflectionTest, InstantiateTemplateFunctionFromString) {
534-
if (RUNNING_ON_VALGRIND)
534+
if (llvm::sys::RunningOnValgrind())
535535
GTEST_SKIP() << "XFAIL due to Valgrind report";
536536
Cpp::CreateInterpreter();
537537
std::string code = R"(#include <memory>)";
@@ -734,7 +734,7 @@ TEST(FunctionReflectionTest, IsStaticMethod) {
734734
}
735735

736736
TEST(FunctionReflectionTest, GetFunctionAddress) {
737-
if (RUNNING_ON_VALGRIND)
737+
if (llvm::sys::RunningOnValgrind())
738738
GTEST_SKIP() << "XFAIL due to Valgrind report";
739739
std::vector<Decl*> Decls, SubDecls;
740740
std::string code = "int f1(int i) { return i * i; }";
@@ -775,7 +775,7 @@ TEST(FunctionReflectionTest, IsVirtualMethod) {
775775
}
776776

777777
TEST(FunctionReflectionTest, JitCallAdvanced) {
778-
if (RUNNING_ON_VALGRIND)
778+
if (llvm::sys::RunningOnValgrind())
779779
GTEST_SKIP() << "XFAIL due to Valgrind report";
780780
std::vector<Decl*> Decls;
781781
std::string code = R"(
@@ -799,7 +799,7 @@ TEST(FunctionReflectionTest, JitCallAdvanced) {
799799

800800

801801
TEST(FunctionReflectionTest, GetFunctionCallWrapper) {
802-
if (RUNNING_ON_VALGRIND)
802+
if (llvm::sys::RunningOnValgrind())
803803
GTEST_SKIP() << "XFAIL due to Valgrind report";
804804
std::vector<Decl*> Decls;
805805
std::string code = R"(
@@ -1010,7 +1010,7 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) {
10101010
}
10111011

10121012
TEST(FunctionReflectionTest, Construct) {
1013-
if (RUNNING_ON_VALGRIND)
1013+
if (llvm::sys::RunningOnValgrind())
10141014
GTEST_SKIP() << "XFAIL due to Valgrind report";
10151015
Cpp::CreateInterpreter();
10161016

@@ -1046,7 +1046,7 @@ TEST(FunctionReflectionTest, Construct) {
10461046
}
10471047

10481048
TEST(FunctionReflectionTest, Destruct) {
1049-
if (RUNNING_ON_VALGRIND)
1049+
if (llvm::sys::RunningOnValgrind())
10501050
GTEST_SKIP() << "XFAIL due to Valgrind report";
10511051
Cpp::CreateInterpreter();
10521052

unittests/CppInterOp/InterpreterTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ TEST(InterpreterTest, DebugFlag) {
4545
}
4646

4747
TEST(InterpreterTest, Evaluate) {
48-
if (RUNNING_ON_VALGRIND)
48+
if (llvm::sys::RunningOnValgrind())
4949
GTEST_SKIP() << "XFAIL due to Valgrind report";
5050
// EXPECT_TRUE(Cpp::Evaluate(I, "") == 0);
5151
//EXPECT_TRUE(Cpp::Evaluate(I, "__cplusplus;") == 201402);
@@ -61,7 +61,7 @@ TEST(InterpreterTest, Evaluate) {
6161
}
6262

6363
TEST(InterpreterTest, Process) {
64-
if (RUNNING_ON_VALGRIND)
64+
if (llvm::sys::RunningOnValgrind())
6565
GTEST_SKIP() << "XFAIL due to Valgrind report";
6666
Cpp::CreateInterpreter();
6767
EXPECT_TRUE(Cpp::Process("") == 0);

unittests/CppInterOp/JitTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ static int printf_jit(const char* format, ...) {
1212
}
1313

1414
TEST(JitTest, InsertOrReplaceJitSymbol) {
15-
if (RUNNING_ON_VALGRIND)
15+
if (llvm::sys::RunningOnValgrind())
1616
GTEST_SKIP() << "XFAIL due to Valgrind report";
1717
std::vector<Decl*> Decls;
1818
std::string code = R"(

unittests/CppInterOp/ScopeReflectionTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ template<typename T> T TrivialFnTemplate() { return T(); }
800800
}
801801

802802
TEST(ScopeReflectionTest, InstantiateTemplateFunctionFromString) {
803-
if (RUNNING_ON_VALGRIND)
803+
if (llvm::sys::RunningOnValgrind())
804804
GTEST_SKIP() << "XFAIL due to Valgrind report";
805805
Cpp::CreateInterpreter();
806806
std::string code = R"(#include <memory>)";
@@ -940,7 +940,7 @@ TEST(ScopeReflectionTest, GetClassTemplateInstantiationArgs) {
940940

941941

942942
TEST(ScopeReflectionTest, IncludeVector) {
943-
if (RUNNING_ON_VALGRIND)
943+
if (llvm::sys::RunningOnValgrind())
944944
GTEST_SKIP() << "XFAIL due to Valgrind report";
945945
std::string code = R"(
946946
#include <vector>

unittests/CppInterOp/TypeReflectionTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ TEST(TypeReflectionTest, IsPODType) {
523523
}
524524

525525
TEST(TypeReflectionTest, IsSmartPtrType) {
526-
if (RUNNING_ON_VALGRIND)
526+
if (llvm::sys::RunningOnValgrind())
527527
GTEST_SKIP() << "XFAIL due to Valgrind report";
528528
Cpp::CreateInterpreter();
529529

unittests/CppInterOp/Utils.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55

66
#include <memory>
77
#include <vector>
8-
9-
#ifndef __APPLE__
10-
#include <valgrind/valgrind.h>
11-
#endif //__APPLE__
12-
13-
#ifdef __APPLE__
14-
#define RUNNING_ON_VALGRIND 0
15-
#endif //__APPLE__
8+
#include "llvm/Support/Valgrind.h"
169

1710
using namespace clang;
1811
using namespace llvm;

0 commit comments

Comments
 (0)