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=f.o --regex --find=function %t | FileCheck %s
6 //
7 // RUN: %clang %s -g -c -o %t --target=x86_64-apple-macosx
8 // RUN: lldb-test symbols --name=f.o --regex --find=function %t | FileCheck %s
9 
10 // RUN: %clang %s -g -c -o %t.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames
11 // RUN: ld.lld %t.o -o %t
12 // RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES
13 // RUN: lldb-test symbols --name=f.o --regex --find=function %t | FileCheck %s
14 
15 // NAMES: Name: .debug_names
16 
17 // CHECK: Found 3 functions:
18 // CHECK-DAG: name = "foo()", mangled = "_Z3foov"
19 // CHECK-DAG: name = "ffo()", mangled = "_Z3ffov"
20 // CHECK-DAG: name = "bar::foo()", mangled = "_ZN3bar3fooEv"
21 
foo()22 void foo() {}
ffo()23 void ffo() {}
24 namespace bar {
foo()25 void foo() {}
26 } // namespace bar
fof()27 void fof() {}
28 
_start()29 extern "C" void _start() {}
30