xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/find-type-in-function.cpp (revision 87aa9c9e4d41ed881453e2fab85b3d25f648bb55)
1 // REQUIRES: lld
2 
3 // XFAIL: *
4 
5 // RUN: %clang %s -g -c -o %t.o --target=x86_64-pc-linux
6 // RUN: ld.lld %t.o -o %t
7 // RUN: lldb-test symbols --name=foo --find=type %t | \
8 // RUN:   FileCheck --check-prefix=NAME %s
9 
10 // Lookup for "foo" should find either both "struct foo" types or just the
11 // global one. Right now, it finds the definition inside bar(), which is
12 // definitely wrong.
13 
14 // NAME: Found 2 types:
15 struct foo {};
16 // NAME-DAG: name = "foo", {{.*}} decl = find-type-in-function.cpp:[[@LINE-1]]
17 
bar()18 void bar() {
19   struct foo {};
20 // NAME-DAG: name = "foo", {{.*}} decl = find-type-in-function.cpp:[[@LINE-1]]
21   foo a;
22 }
23 
_start(foo)24 extern "C" void _start(foo) {}
25