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