[lldb-instr] Test that we ignore existing macros.

Although the functionality was already present, it wasn't tested.

llvm-svn: 354303
This commit is contained in:
Jonas Devlieghere 2019-02-19 01:20:49 +00:00
parent 091b925284
commit cd2e6c75f6
3 changed files with 13 additions and 1 deletions

View File

@ -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 @@ void Foo::E() {}
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()); }

View File

@ -1,3 +1,4 @@
struct Bar {};
struct Foo {
Foo();
Foo(int i);
@ -8,6 +9,8 @@ struct Foo {
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;
};

View File

@ -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());