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=type %t | \
6// RUN: FileCheck --check-prefix=NAME %s
7// RUN: lldb-test symbols --name=::foo --find=type %t | \
8// RUN: FileCheck --check-prefix=EXACT %s
9// RUN: lldb-test symbols --name=foo --context=context --find=type %t | \
10// RUN: FileCheck --check-prefix=CONTEXT %s
11// RUN: lldb-test symbols --name=not_there --find=type %t | \
12// RUN: FileCheck --check-prefix=EMPTY %s
13//
14// RUN: %clang %s -g -c -o %t --target=x86_64-apple-macosx
15// RUN: lldb-test symbols --name=foo --find=type %t | \
16// RUN: FileCheck --check-prefix=NAME %s
17// RUN: lldb-test symbols --name=::foo --find=type %t | \
18// RUN: FileCheck --check-prefix=EXACT %s
19// RUN: lldb-test symbols --name=foo --context=context --find=type %t | \
20// RUN: FileCheck --check-prefix=CONTEXT %s
21// RUN: lldb-test symbols --name=not_there --find=type %t | \
22// RUN: FileCheck --check-prefix=EMPTY %s
23
24// RUN: %clang %s -c -o %t.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames
25// RUN: ld.lld %t.o -o %t
26// RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES
27// RUN: lldb-test symbols --name=foo --find=type %t | \
28// RUN: FileCheck --check-prefix=NAME %s
29// RUN: lldb-test symbols --name=::foo --find=type %t | \
30// RUN: FileCheck --check-prefix=EXACT %s
31// RUN: lldb-test symbols --name=foo --context=context --find=type %t | \
32// RUN: FileCheck --check-prefix=CONTEXT %s
33// RUN: lldb-test symbols --name=not_there --find=type %t | \
34// RUN: FileCheck --check-prefix=EMPTY %s
35
36// NAMES: Name: .debug_names
37
38// EMPTY: Found 0 types:
39// NAME: Found 4 types:
40// EXACT: Found 1 types:
41// CONTEXT: Found 1 types:
42struct foo { };
43// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]]
44// EXACT-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-2]]
45
46namespace bar {
47int context;
48struct foo {};
49// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]]
50// CONTEXT-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-2]]
51namespace baz {
52struct foo {};
53// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]]
54}
55}
56
57struct sbar {
58 struct foo {};
59// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]]
60};
61
62struct foobar {};
63
64struct Foo {};
65
66extern "C" void _start(foo, bar::foo, bar::baz::foo, sbar::foo, foobar, Foo) {}
67

source code of lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-type.cpp