[Lldb-commits] [lldb] r354294 - [lldb-instr] Add constructor and move test into lit/tools

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 18 14:59:52 PST 2019


Author: jdevlieghere
Date: Mon Feb 18 14:59:52 2019
New Revision: 354294

URL: http://llvm.org/viewvc/llvm-project?rev=354294&view=rev
Log:
[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.

Added:
    lldb/trunk/lit/tools/lldb-instr/
    lldb/trunk/lit/tools/lldb-instr/Inputs/
    lldb/trunk/lit/tools/lldb-instr/Inputs/foo.cpp
    lldb/trunk/lit/tools/lldb-instr/Inputs/foo.h
    lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRecord.test
    lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRegister.test
Removed:
    lldb/trunk/lit/Reproducer/Inputs/foo.cpp
    lldb/trunk/lit/Reproducer/TestInstrumentationRecord.test
    lldb/trunk/lit/Reproducer/TestInstrumentationRegister.test

Removed: lldb/trunk/lit/Reproducer/Inputs/foo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/Inputs/foo.cpp?rev=354293&view=auto
==============================================================================
--- lldb/trunk/lit/Reproducer/Inputs/foo.cpp (original)
+++ lldb/trunk/lit/Reproducer/Inputs/foo.cpp (removed)
@@ -1,18 +0,0 @@
-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);
-};
-
-void Foo::A() {}
-void Foo::B(int i) {}
-int Foo::C(int i) { return i; }
-int Foo::D(bool b) const { return 1; }
-void Foo::E() {}
-int Foo::F(int i) { return i; }

Removed: lldb/trunk/lit/Reproducer/TestInstrumentationRecord.test
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/TestInstrumentationRecord.test?rev=354293&view=auto
==============================================================================
--- lldb/trunk/lit/Reproducer/TestInstrumentationRecord.test (original)
+++ lldb/trunk/lit/Reproducer/TestInstrumentationRecord.test (removed)
@@ -1,10 +0,0 @@
-# RUN: cp %p/Inputs/foo.cpp %t.cpp
-# RUN: lldb-instr %t.cpp
-# RUN: cat %t.cpp | FileCheck %s
-
-# 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);
-# CHECK: LLDB_RECORD_METHOD_CONST(int, Foo, D, (bool), b);
-# CHECK: LLDB_RECORD_STATIC_METHOD_NO_ARGS(void, Foo, E);
-# CHECK: LLDB_RECORD_STATIC_METHOD(int, Foo, F, (int), i);

Removed: lldb/trunk/lit/Reproducer/TestInstrumentationRegister.test
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Reproducer/TestInstrumentationRegister.test?rev=354293&view=auto
==============================================================================
--- lldb/trunk/lit/Reproducer/TestInstrumentationRegister.test (original)
+++ lldb/trunk/lit/Reproducer/TestInstrumentationRegister.test (removed)
@@ -1,9 +0,0 @@
-# RUN: cp %p/Inputs/foo.cpp %t.cpp
-# RUN: lldb-instr %t.cpp | FileCheck %s
-
-# CHECK: LLDB_REGISTER_METHOD(void, Foo, A, ());
-# CHECK: LLDB_REGISTER_METHOD(void, Foo, B, (int));
-# CHECK: LLDB_REGISTER_METHOD(int, Foo, C, (int));
-# CHECK: LLDB_REGISTER_METHOD_CONST(int, Foo, D, (bool));
-# CHECK: LLDB_REGISTER_STATIC_METHOD(void, Foo, E, ());
-# CHECK: LLDB_REGISTER_STATIC_METHOD(int, Foo, F, (int));

Added: lldb/trunk/lit/tools/lldb-instr/Inputs/foo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-instr/Inputs/foo.cpp?rev=354294&view=auto
==============================================================================
--- lldb/trunk/lit/tools/lldb-instr/Inputs/foo.cpp (added)
+++ lldb/trunk/lit/tools/lldb-instr/Inputs/foo.cpp Mon Feb 18 14:59:52 2019
@@ -0,0 +1,9 @@
+#include "foo.h"
+
+Foo::Foo() {}
+void Foo::A() {}
+void Foo::B(int i) {}
+int Foo::C(int i) { return i; }
+int Foo::D(bool b) const { return 1; }
+void Foo::E() {}
+int Foo::F(int i) { return i; }

Added: lldb/trunk/lit/tools/lldb-instr/Inputs/foo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-instr/Inputs/foo.h?rev=354294&view=auto
==============================================================================
--- lldb/trunk/lit/tools/lldb-instr/Inputs/foo.h (added)
+++ lldb/trunk/lit/tools/lldb-instr/Inputs/foo.h Mon Feb 18 14:59:52 2019
@@ -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; }
+};

Added: lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRecord.test
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRecord.test?rev=354294&view=auto
==============================================================================
--- lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRecord.test (added)
+++ lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRecord.test Mon Feb 18 14:59:52 2019
@@ -0,0 +1,14 @@
+# 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);
+# CHECK: LLDB_RECORD_METHOD_CONST(int, Foo, D, (bool), b);
+# CHECK: LLDB_RECORD_STATIC_METHOD_NO_ARGS(void, Foo, E);
+# CHECK: LLDB_RECORD_STATIC_METHOD(int, Foo, F, (int), i);

Added: lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRegister.test
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRegister.test?rev=354294&view=auto
==============================================================================
--- lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRegister.test (added)
+++ lldb/trunk/lit/tools/lldb-instr/TestInstrumentationRegister.test Mon Feb 18 14:59:52 2019
@@ -0,0 +1,12 @@
+# 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));
+# CHECK: LLDB_REGISTER_METHOD(int, Foo, C, (int));
+# CHECK: LLDB_REGISTER_METHOD_CONST(int, Foo, D, (bool));
+# CHECK: LLDB_REGISTER_STATIC_METHOD(void, Foo, E, ());
+# CHECK: LLDB_REGISTER_STATIC_METHOD(int, Foo, F, (int));




More information about the lldb-commits mailing list