summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-02-18 22:59:52 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-02-18 22:59:52 +0000
commitd1511a4bc734050899bd103cfced2a3dd9be2481 (patch)
tree208776f1c2fd8f8910738d14fe09e22e7f1b78d4
parentfbe92a53d073bf03c47870a11589868424863ca0 (diff)
downloadbcm5719-llvm-d1511a4bc734050899bd103cfced2a3dd9be2481.tar.gz
bcm5719-llvm-d1511a4bc734050899bd103cfced2a3dd9be2481.zip
[lldb-instr] Add constructor and move test into lit/tools
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
-rw-r--r--lldb/lit/tools/lldb-instr/Inputs/foo.cpp (renamed from lldb/lit/Reproducer/Inputs/foo.cpp)13
-rw-r--r--lldb/lit/tools/lldb-instr/Inputs/foo.h12
-rw-r--r--lldb/lit/tools/lldb-instr/TestInstrumentationRecord.test (renamed from lldb/lit/Reproducer/TestInstrumentationRecord.test)10
-rw-r--r--lldb/lit/tools/lldb-instr/TestInstrumentationRegister.test (renamed from lldb/lit/Reproducer/TestInstrumentationRegister.test)7
4 files changed, 26 insertions, 16 deletions
diff --git a/lldb/lit/Reproducer/Inputs/foo.cpp b/lldb/lit/tools/lldb-instr/Inputs/foo.cpp
index c4fa86005b5..7db0452b9e5 100644
--- a/lldb/lit/Reproducer/Inputs/foo.cpp
+++ b/lldb/lit/tools/lldb-instr/Inputs/foo.cpp
@@ -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
index 00000000000..63b6cab828c
--- /dev/null
+++ b/lldb/lit/tools/lldb-instr/Inputs/foo.h
@@ -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; }
+};
diff --git a/lldb/lit/Reproducer/TestInstrumentationRecord.test b/lldb/lit/tools/lldb-instr/TestInstrumentationRecord.test
index 0e6202b36dc..6f940b64c56 100644
--- a/lldb/lit/Reproducer/TestInstrumentationRecord.test
+++ b/lldb/lit/tools/lldb-instr/TestInstrumentationRecord.test
@@ -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);
diff --git a/lldb/lit/Reproducer/TestInstrumentationRegister.test b/lldb/lit/tools/lldb-instr/TestInstrumentationRegister.test
index a1d859bbbad..300158c7220 100644
--- a/lldb/lit/Reproducer/TestInstrumentationRegister.test
+++ b/lldb/lit/tools/lldb-instr/TestInstrumentationRegister.test
@@ -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));
OpenPOWER on IntegriCloud