1 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
2 RUN: | llvm-dwarfdump -name=not_there_at_all - | \
3 RUN: FileCheck %s --check-prefix=EMPTY --allow-empty
6 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
7 RUN: | llvm-dwarfdump -name=main - | FileCheck %s
8 CHECK: : DW_TAG_subprogram
10 CHECK: DW_AT_name ("main")
13 RUN: llvm-dwarfdump %S/../../dsymutil/Inputs/libfat-test.a \
14 RUN: -name=x86_64h_var -name=i386_var \
15 RUN: | FileCheck %s --check-prefix=MULTI
16 MULTI: Mach-O 32-bit i386
18 MULTI: : DW_TAG_variable
20 MULTI: DW_AT_name ("i386_var")
22 MULTI: Mach-O 64-bit x86-64
23 MULTI: : DW_TAG_variable
25 MULTI: DW_AT_name ("x86_64h_var")
28 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
29 RUN: | llvm-dwarfdump -name=int - | FileCheck %s --check-prefix=TYPES
30 TYPES: : DW_TAG_base_type
32 TYPES: DW_AT_name ("int")
35 This is one where --name observably behaves different from --find.
36 RUN: llvm-dwarfdump %S/../../dsymutil/Inputs/odr-anon-namespace/1.o \
37 RUN: -name="(anonymous namespace)" \
38 RUN: | FileCheck %s --check-prefix=EMPTY
40 Test the -ignore-case option.
41 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
42 RUN: | llvm-dwarfdump -name=Main - | FileCheck %s -check-prefix=EMPTY
43 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
44 RUN: | llvm-dwarfdump -name=Main -i - | FileCheck %s
45 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
46 RUN: | llvm-dwarfdump -name=MAIN -ignore-case - | FileCheck %s
48 Test the -regex option.
49 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
50 RUN: | llvm-dwarfdump -regex -name=m.+n - | FileCheck %s
51 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
52 RUN: | llvm-dwarfdump -x -name=m.+n - | FileCheck %s
53 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
54 RUN: | llvm-dwarfdump -x -i -name=M.+n - | FileCheck %s
55 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
56 RUN: | not llvm-dwarfdump -x -name=+ - 2>&1 | FileCheck %s --check-prefix=ERR
58 RUN: llvm-dwarfdump %S/../../dsymutil/Inputs/libfat-test.a \
59 RUN: -x -name=x86_64h_var -name=i386_var \
60 RUN: | FileCheck %s --check-prefix=MULTI
61 RUN: llvm-dwarfdump %S/../../dsymutil/Inputs/libfat-test.a \
62 RUN: -x -name=.*86.*_var \
63 RUN: | FileCheck %s --check-prefix=MULTI
65 Test the -show-children behavior.
66 RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
67 RUN: | llvm-dwarfdump -name="brief.c" - | FileCheck %s -check-prefix=NOCHILDREN
68 NOCHILDREN: DW_AT_name ("brief.c")
69 NOCHILDREN-NOT: DW_TAG
71 Test that --name also searches in DW_AT_linkage_name.
72 RUN: llc -O0 %S/statistics.ll -filetype obj -o - \
73 RUN: | llvm-dwarfdump -name=_Z4cubei - | FileCheck %s --check-prefix=LINKAGE
74 LINKAGE: DW_AT_name ("cube")