[Lldb-commits] [lldb] r332833 - Improve coverage of the apple-tables test

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon May 21 03:09:22 PDT 2018


Author: labath
Date: Mon May 21 03:09:22 2018
New Revision: 332833

URL: http://llvm.org/viewvc/llvm-project?rev=332833&view=rev
Log:
Improve coverage of the apple-tables test

After closer examination, it turns out we mis-classify one of the
methods only if two of the structs have the same name. Since this was
meant to be a basic test, I rename one of the structs in the test so
that we have at least some coverage for the apple tables lookup.
Instead, I create an XFAILed test which specifically targets the
same-name case (and file a bug to track it).

Added:
    lldb/trunk/lit/SymbolFile/DWARF/find-method-local-struct.cpp
Modified:
    lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp

Modified: lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp?rev=332833&r1=332832&r2=332833&view=diff
==============================================================================
--- lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp Mon May 21 03:09:22 2018
@@ -16,6 +16,10 @@
 // RUN:   FileCheck --check-prefix=EMPTY %s
 //
 // RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=base %t | \
+// RUN:   FileCheck --check-prefix=BASE %s
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
+// RUN:   FileCheck --check-prefix=METHOD %s
 // RUN: lldb-test symbols --name=foo --find=function --function-flags=full %t | \
 // RUN:   FileCheck --check-prefix=FULL %s
 // RUN: lldb-test symbols --name=_Z3fooi --find=function --function-flags=full %t | \
@@ -34,7 +38,7 @@
 // METHOD: Found 3 functions:
 // METHOD-DAG: name = "sbar::foo()", mangled = "_ZN4sbar3fooEv"
 // METHOD-DAG: name = "sbar::foo(int)", mangled = "_ZN4sbar3fooEi"
-// METHOD-DAG: name = "ffbar()::sbar::foo()", mangled = "_ZZ5ffbarvEN4sbar3fooEv"
+// METHOD-DAG: name = "ffbar()::sbaz::foo()", mangled = "_ZZ5ffbarvEN4sbaz3fooEv"
 
 // FULL: Found 7 functions:
 // FULL-DAG: name = "foo()", mangled = "_Z3foov"
@@ -43,7 +47,7 @@
 // FULL-DAG: name = "bar::baz::foo()", mangled = "_ZN3bar3baz3fooEv"
 // FULL-DAG: name = "sbar::foo()", mangled = "_ZN4sbar3fooEv"
 // FULL-DAG: name = "sbar::foo(int)", mangled = "_ZN4sbar3fooEi"
-// FULL-DAG: name = "ffbar()::sbar::foo()", mangled = "_ZZ5ffbarvEN4sbar3fooEv"
+// FULL-DAG: name = "ffbar()::sbaz::foo()", mangled = "_ZZ5ffbarvEN4sbaz3fooEv"
 
 // FULL-MANGLED: Found 1 functions:
 // FULL-DAG: name = "foo(int)", mangled = "_Z3fooi"
@@ -77,10 +81,10 @@ void sbar::foo() {}
 void sbar::foo(int) {}
 
 void ffbar() {
-  struct sbar {
+  struct sbaz {
     void foo() {}
   };
-  sbar a;
+  sbaz a;
   a.foo();
 }
 

Added: lldb/trunk/lit/SymbolFile/DWARF/find-method-local-struct.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-method-local-struct.cpp?rev=332833&view=auto
==============================================================================
--- lldb/trunk/lit/SymbolFile/DWARF/find-method-local-struct.cpp (added)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-method-local-struct.cpp Mon May 21 03:09:22 2018
@@ -0,0 +1,22 @@
+// llvm.org/pr37537
+// XFAIL: *
+
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
+// RUN:   FileCheck %s
+
+// CHECK-DAG: name = "sbar::foo()", mangled = "_ZN4sbar3fooEv"
+// CHECK-DAG: name = "ffbar()::sbar::foo()", mangled = "_ZZ5ffbarvEN4sbar3fooEv"
+
+struct sbar {
+  void foo();
+};
+void sbar::foo() {}
+
+void ffbar() {
+  struct sbar {
+    void foo() {}
+  };
+  sbar a;
+  a.foo();
+}




More information about the lldb-commits mailing list