[lldb-instr] Test that we ignore existing macros.
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 19 Feb 2019 01:20:49 +0000 (01:20 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 19 Feb 2019 01:20:49 +0000 (01:20 +0000)
Although the functionality was already present, it wasn't tested.

llvm-svn: 354303

lldb/lit/tools/lldb-instr/Inputs/foo.cpp
lldb/lit/tools/lldb-instr/Inputs/foo.h
lldb/lit/tools/lldb-instr/TestInstrumentationRecord.test

index 51c8975..bef01dc 100644 (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()); }
index 9139604..95c0c00 100644 (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 charfmt...);
+  void G(const char *fmt...);
   static Foo H();
+  void I() const;
+  Bar J() const;
 };
index 6921a04..af33df0 100644 (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());