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: |
42 | struct 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 | |
46 | namespace bar { |
47 | int context; |
48 | struct 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]] |
51 | namespace baz { |
52 | struct foo {}; |
53 | // NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]] |
54 | } |
55 | } |
56 | |
57 | struct sbar { |
58 | struct foo {}; |
59 | // NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]] |
60 | }; |
61 | |
62 | struct foobar {}; |
63 | |
64 | struct Foo {}; |
65 | |
66 | extern "C" void _start(foo, bar::foo, bar::baz::foo, sbar::foo, foobar, Foo) {} |
67 | |