xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/find-method.cpp (revision 8a64d80a959bf2844df33f9112e456f33de7b468)
1 // REQUIRES: lld
2 
3 // RUN: %clang %s -g -c -o %t.o --target=x86_64-pc-linux -gno-pubnames
4 // RUN: ld.lld %t.o -o %t
5 // RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
6 // RUN:   FileCheck %s
7 //
8 // RUN: %clang %s -g -c -o %t --target=x86_64-apple-macosx
9 // RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
10 // RUN:   FileCheck %s
11 
12 // RUN: %clang %s -c -o %t.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames
13 // RUN: ld.lld %t.o -o %t
14 // RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES
15 // RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
16 // RUN:   FileCheck %s
17 
18 // NAMES: Name: .debug_names
19 
20 // CHECK-DAG: name = "A::foo()", mangled = "_ZN1A3fooEv"
21 // CHECK-DAG: name = "B::foo()", mangled = "_ZN1B3fooEv"
22 // CHECK-DAG: name = "C::foo()", mangled = "_ZN1C3fooEv"
23 
24 struct A {
25   void foo();
26 };
foo()27 void A::foo() {}
28 
29 class B {
30   void foo();
31 };
foo()32 void B::foo() {}
33 
34 union C {
35   void foo();
36 };
foo()37 void C::foo() {}
38 
_start()39 extern "C" void _start() {}
40