[lldb-instr] Test that we ignore existing macros.
Although the functionality was already present, it wasn't tested.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@354303 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lit/tools/lldb-instr/Inputs/foo.cpp b/lit/tools/lldb-instr/Inputs/foo.cpp
index 51c8975..bef01dc 100644
--- a/lit/tools/lldb-instr/Inputs/foo.cpp
+++ b/lit/tools/lldb-instr/Inputs/foo.cpp
@@ -1,5 +1,9 @@
#include "foo.h"
+#define MACRO_FOO \
+ { void; }
+#define MACRO_BAR(B) B
+
Foo::Foo() {}
void Foo::A() {}
void Foo::B(int i) {}
@@ -9,3 +13,5 @@
int Foo::F(int i) { return i; }
void Foo::G(const char *fmt...) {}
Foo Foo::H() { return Foo(); }
+void Foo::I() const { MACRO_FOO; }
+Bar Foo::J() const { return MACRO_BAR(Bar()); }
diff --git a/lit/tools/lldb-instr/Inputs/foo.h b/lit/tools/lldb-instr/Inputs/foo.h
index 9139604..95c0c00 100644
--- a/lit/tools/lldb-instr/Inputs/foo.h
+++ b/lit/tools/lldb-instr/Inputs/foo.h
@@ -1,3 +1,4 @@
+struct Bar {};
struct Foo {
Foo();
Foo(int i);
@@ -8,6 +9,8 @@
int D(bool b) const;
static void E();
static int F(int i);
- void G(const char* fmt...);
+ void G(const char *fmt...);
static Foo H();
+ void I() const;
+ Bar J() const;
};
diff --git a/lit/tools/lldb-instr/TestInstrumentationRecord.test b/lit/tools/lldb-instr/TestInstrumentationRecord.test
index 6921a04..af33df0 100644
--- a/lit/tools/lldb-instr/TestInstrumentationRecord.test
+++ b/lit/tools/lldb-instr/TestInstrumentationRecord.test
@@ -15,3 +15,6 @@
# CHECK-NOT: LLDB_RECORD_STATIC_METHOD(void, Foo, G
# CHECK: LLDB_RECORD_STATIC_METHOD_NO_ARGS(Foo, Foo, H);
# CHECK: LLDB_RECORD_RESULT(Foo())
+# CHECK-NOT: LLDB_RECORD_METHOD_CONST_NO_ARGS(void, Foo, I);
+# CHECK: LLDB_RECORD_METHOD_CONST_NO_ARGS(Bar, Foo, J);
+# CHECK-NOT: LLDB_RECORD_RESULT(Bar());