[lldb-instr] Add constructor and move test into lit/tools
authorJonas Devlieghere <jonas@devlieghere.com>
Mon, 18 Feb 2019 22:59:52 +0000 (22:59 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Mon, 18 Feb 2019 22:59:52 +0000 (22:59 +0000)
The test had an implicit constructor for the Foo struct. Also, as the
instrumentation doesn't have to be reproducer specific, I moved the
tests into the lit/tools directory.

llvm-svn: 354294

lldb/lit/tools/lldb-instr/Inputs/foo.cpp [moved from lldb/lit/Reproducer/Inputs/foo.cpp with 51% similarity]
lldb/lit/tools/lldb-instr/Inputs/foo.h [new file with mode: 0644]
lldb/lit/tools/lldb-instr/TestInstrumentationRecord.test [moved from lldb/lit/Reproducer/TestInstrumentationRecord.test with 59% similarity]
lldb/lit/tools/lldb-instr/TestInstrumentationRegister.test [moved from lldb/lit/Reproducer/TestInstrumentationRegister.test with 67% similarity]

similarity index 51%
rename from lldb/lit/Reproducer/Inputs/foo.cpp
rename to lldb/lit/tools/lldb-instr/Inputs/foo.cpp
index c4fa860..7db0452 100644 (file)
@@ -1,15 +1,6 @@
-struct Foo {
-  Foo();
-  Foo(int i);
-
-  void A();
-  void B(int i);
-  int C(int i);
-  int D(bool b) const;
-  static void E();
-  static int F(int i);
-};
+#include "foo.h"
 
+Foo::Foo() {}
 void Foo::A() {}
 void Foo::B(int i) {}
 int Foo::C(int i) { return i; }
diff --git a/lldb/lit/tools/lldb-instr/Inputs/foo.h b/lldb/lit/tools/lldb-instr/Inputs/foo.h
new file mode 100644 (file)
index 0000000..63b6cab
--- /dev/null
@@ -0,0 +1,12 @@
+struct Foo {
+  Foo();
+  Foo(int i);
+
+  void A();
+  void B(int i);
+  int C(int i);
+  int D(bool b) const;
+  static void E();
+  static int F(int i);
+  int G() { return 0; }
+};
@@ -1,7 +1,11 @@
-# RUN: cp %p/Inputs/foo.cpp %t.cpp
-# RUN: lldb-instr %t.cpp
-# RUN: cat %t.cpp | FileCheck %s
+# RUN: mkdir -p %t.dir
+# RUN: cp %p/Inputs/foo.cpp %t.dir/foo.cpp
+# RUN: cp %p/Inputs/foo.h %t.dir/foo.h
 
+# RUN: lldb-instr %t.dir/foo.cpp
+# RUN: cat %t.dir/foo.cpp | FileCheck %s
+
+# CHECK: LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Foo);
 # CHECK: LLDB_RECORD_METHOD_NO_ARGS(void, Foo, A);
 # CHECK: LLDB_RECORD_METHOD(void, Foo, B, (int), i);
 # CHECK: LLDB_RECORD_METHOD(int, Foo, C, (int), i);
@@ -1,5 +1,8 @@
-# RUN: cp %p/Inputs/foo.cpp %t.cpp
-# RUN: lldb-instr %t.cpp | FileCheck %s
+# RUN: mkdir -p %t.dir
+# RUN: cp %p/Inputs/foo.cpp %t.dir/foo.cpp
+# RUN: cp %p/Inputs/foo.h %t.dir/foo.h
+
+# RUN: lldb-instr %t.dir/foo.cpp | FileCheck %s
 
 # CHECK: LLDB_REGISTER_METHOD(void, Foo, A, ());
 # CHECK: LLDB_REGISTER_METHOD(void, Foo, B, (int));