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:
15struct foo {};
16// NAME-DAG: name = "foo", {{.*}} decl = find-type-in-function.cpp:[[@LINE-1]]
17
18void bar() {
19 struct foo {};
20// NAME-DAG: name = "foo", {{.*}} decl = find-type-in-function.cpp:[[@LINE-1]]
21 foo a;
22}
23
24extern "C" void _start(foo) {}
25

source code of lldb/test/Shell/SymbolFile/DWARF/find-type-in-function.cpp