xref: /llvm-project/llvm/test/DebugInfo/symbolize-filter-markup-pc.test (revision 7b31a73ffe87e6302ab433da8128058fce8f54bd)
1bf48b128SDaniel ThornburghREQUIRES: x86-registered-target
2bf48b128SDaniel ThornburghRUN: split-file %s %t
3bf48b128SDaniel ThornburghRUN: mkdir -p %t/.build-id/ab
4bf48b128SDaniel ThornburghRUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t/asm.s \
5bf48b128SDaniel ThornburghRUN:   -o %t/.build-id/ab/cdef.debug
6bf48b128SDaniel ThornburghRUN: llvm-symbolizer --debug-file-directory=%t --filter-markup < %t/input \
7bf48b128SDaniel ThornburghRUN:   > %t.output 2> %t.err
8bf48b128SDaniel ThornburghRUN: FileCheck %s --input-file=%t.output --match-full-lines \
9bf48b128SDaniel ThornburghRUN:   --implicit-check-not {{.}}
10bf48b128SDaniel ThornburghRUN: FileCheck %s --check-prefix=ERR --input-file=%t.err --match-full-lines
11bf48b128SDaniel Thornburgh
12bf48b128SDaniel ThornburghCHECK: [[BEGIN:\[{3}]]ELF module #0x0 "a.o"; BuildID=abcdef [0x0-0xff](r)[[END:\]{3}]]
130d6cf1e8SDaniel ThornburghCHECK: first[/dir[[SEP:[/\\]]]tmp.c:3]
140d6cf1e8SDaniel ThornburghCHECK: first[/dir[[SEP]]tmp.c:5]
150d6cf1e8SDaniel ThornburghCHECK: first[/dir[[SEP]]tmp.c:4]
160d6cf1e8SDaniel ThornburghCHECK: first[/dir[[SEP]]tmp.c:5]
17*7b31a73fSDaniel Thornburgh
18bf48b128SDaniel ThornburghCHECK: [[BEGIN]]pc:0xff[[END]]
19bf48b128SDaniel ThornburghCHECK: [[BEGIN]]pc:0x100[[END]]
20*7b31a73fSDaniel ThornburghCHECK: first[/dir[[SEP]]tmp.c:5]
21*7b31a73fSDaniel ThornburghERR: error: no mmap covers address
22*7b31a73fSDaniel ThornburghERR: warning: expected at most 2 field(s); found 3
23bf48b128SDaniel Thornburgh
24bf48b128SDaniel ThornburghERR: error: expected at least 1 field(s); found 0
25bf48b128SDaniel ThornburghERR: error: expected PC type; found ''
26bf48b128SDaniel Thornburgh
27bf48b128SDaniel Thornburgh;--- input
28bf48b128SDaniel Thornburgh{{{module:0:a.o:elf:abcdef}}}
29bf48b128SDaniel Thornburgh{{{mmap:0:256:load:0:r:0}}}
30bf48b128SDaniel Thornburgh{{{pc:0}}}
31bf48b128SDaniel Thornburgh{{{pc:0x9}}}
32bf48b128SDaniel Thornburgh{{{pc:0x9:ra}}}
33bf48b128SDaniel Thornburgh{{{pc:0x9:pc}}}
34*7b31a73fSDaniel Thornburgh
35bf48b128SDaniel Thornburgh{{{pc:0xff}}}
36*7b31a73fSDaniel Thornburgh{{{pc:0x100}}}
37*7b31a73fSDaniel Thornburgh{{{pc:0x9:pc:ext}}}
38bf48b128SDaniel Thornburgh
39bf48b128SDaniel Thornburgh{{{pc}}}
40bf48b128SDaniel Thornburgh{{{pc:0x9:}}}
41bf48b128SDaniel Thornburgh;--- asm.s
42bf48b128SDaniel Thornburgh	.text
43bf48b128SDaniel Thornburgh	.file	"tmp.c"
44bf48b128SDaniel Thornburgh	.globl	first                           # -- Begin function first
45bf48b128SDaniel Thornburgh	.p2align	4, 0x90
46bf48b128SDaniel Thornburgh	.type	first,@function
47bf48b128SDaniel Thornburghfirst:                                  # @first
48bf48b128SDaniel Thornburgh.Lfunc_begin0:
49bf48b128SDaniel Thornburgh	.file	1 "/dir" "tmp.c"
50bf48b128SDaniel Thornburgh	.loc	1 3 0                           # tmp.c:3:0
51bf48b128SDaniel Thornburgh	.cfi_startproc
52bf48b128SDaniel Thornburgh# %bb.0:
53bf48b128SDaniel Thornburgh	pushq	%rbp
54bf48b128SDaniel Thornburgh	.cfi_def_cfa_offset 16
55bf48b128SDaniel Thornburgh	.cfi_offset %rbp, -16
56bf48b128SDaniel Thornburgh	movq	%rsp, %rbp
57bf48b128SDaniel Thornburgh	.cfi_def_cfa_register %rbp
58bf48b128SDaniel Thornburgh.Ltmp0:
59bf48b128SDaniel Thornburgh	.loc	1 4 3 prologue_end              # tmp.c:4:3
60bf48b128SDaniel Thornburgh	callq	second
61bf48b128SDaniel Thornburgh	.loc	1 5 1                           # tmp.c:5:1
62bf48b128SDaniel Thornburgh	popq	%rbp
63bf48b128SDaniel Thornburgh	.cfi_def_cfa %rsp, 8
64bf48b128SDaniel Thornburgh	retq
65bf48b128SDaniel Thornburgh.Ltmp1:
66bf48b128SDaniel Thornburgh.Lfunc_end0:
67bf48b128SDaniel Thornburgh	.size	first, .Lfunc_end0-first
68bf48b128SDaniel Thornburgh	.cfi_endproc
69bf48b128SDaniel Thornburgh                                        # -- End function
70bf48b128SDaniel Thornburgh	.globl	second                          # -- Begin function second
71bf48b128SDaniel Thornburgh	.p2align	4, 0x90
72bf48b128SDaniel Thornburgh	.type	second,@function
73bf48b128SDaniel Thornburghsecond:                                 # @second
74bf48b128SDaniel Thornburgh.Lfunc_begin1:
75bf48b128SDaniel Thornburgh	.loc	1 7 0                           # tmp.c:7:0
76bf48b128SDaniel Thornburgh	.cfi_startproc
77bf48b128SDaniel Thornburgh# %bb.0:
78bf48b128SDaniel Thornburgh	pushq	%rbp
79bf48b128SDaniel Thornburgh	.cfi_def_cfa_offset 16
80bf48b128SDaniel Thornburgh	.cfi_offset %rbp, -16
81bf48b128SDaniel Thornburgh	movq	%rsp, %rbp
82bf48b128SDaniel Thornburgh	.cfi_def_cfa_register %rbp
83bf48b128SDaniel Thornburgh.Ltmp2:
84bf48b128SDaniel Thornburgh	.loc	1 8 3 prologue_end              # tmp.c:8:3
85bf48b128SDaniel Thornburgh	callq	first
86bf48b128SDaniel Thornburgh	.loc	1 9 1                           # tmp.c:9:1
87bf48b128SDaniel Thornburgh	popq	%rbp
88bf48b128SDaniel Thornburgh	.cfi_def_cfa %rsp, 8
89bf48b128SDaniel Thornburgh	retq
90bf48b128SDaniel Thornburgh.Ltmp3:
91bf48b128SDaniel Thornburgh.Lfunc_end1:
92bf48b128SDaniel Thornburgh	.size	second, .Lfunc_end1-second
93bf48b128SDaniel Thornburgh	.cfi_endproc
94bf48b128SDaniel Thornburgh                                        # -- End function
95bf48b128SDaniel Thornburgh	.section	.debug_abbrev,"",@progbits
96bf48b128SDaniel Thornburgh	.byte	1                               # Abbreviation Code
97bf48b128SDaniel Thornburgh	.byte	17                              # DW_TAG_compile_unit
98bf48b128SDaniel Thornburgh	.byte	1                               # DW_CHILDREN_yes
99bf48b128SDaniel Thornburgh	.byte	37                              # DW_AT_producer
100bf48b128SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
101bf48b128SDaniel Thornburgh	.byte	19                              # DW_AT_language
102bf48b128SDaniel Thornburgh	.byte	5                               # DW_FORM_data2
103bf48b128SDaniel Thornburgh	.byte	3                               # DW_AT_name
104bf48b128SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
105bf48b128SDaniel Thornburgh	.byte	16                              # DW_AT_stmt_list
106bf48b128SDaniel Thornburgh	.byte	23                              # DW_FORM_sec_offset
107bf48b128SDaniel Thornburgh	.byte	27                              # DW_AT_comp_dir
108bf48b128SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
109bf48b128SDaniel Thornburgh	.byte	17                              # DW_AT_low_pc
110bf48b128SDaniel Thornburgh	.byte	1                               # DW_FORM_addr
111bf48b128SDaniel Thornburgh	.byte	18                              # DW_AT_high_pc
112bf48b128SDaniel Thornburgh	.byte	6                               # DW_FORM_data4
113bf48b128SDaniel Thornburgh	.byte	0                               # EOM(1)
114bf48b128SDaniel Thornburgh	.byte	0                               # EOM(2)
115bf48b128SDaniel Thornburgh	.byte	2                               # Abbreviation Code
116bf48b128SDaniel Thornburgh	.byte	46                              # DW_TAG_subprogram
117bf48b128SDaniel Thornburgh	.byte	0                               # DW_CHILDREN_no
118bf48b128SDaniel Thornburgh	.byte	17                              # DW_AT_low_pc
119bf48b128SDaniel Thornburgh	.byte	1                               # DW_FORM_addr
120bf48b128SDaniel Thornburgh	.byte	18                              # DW_AT_high_pc
121bf48b128SDaniel Thornburgh	.byte	6                               # DW_FORM_data4
122bf48b128SDaniel Thornburgh	.byte	64                              # DW_AT_frame_base
123bf48b128SDaniel Thornburgh	.byte	24                              # DW_FORM_exprloc
124bf48b128SDaniel Thornburgh	.byte	3                               # DW_AT_name
125bf48b128SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
126bf48b128SDaniel Thornburgh	.byte	58                              # DW_AT_decl_file
127bf48b128SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
128bf48b128SDaniel Thornburgh	.byte	59                              # DW_AT_decl_line
129bf48b128SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
130bf48b128SDaniel Thornburgh	.byte	39                              # DW_AT_prototyped
131bf48b128SDaniel Thornburgh	.byte	25                              # DW_FORM_flag_present
132bf48b128SDaniel Thornburgh	.byte	63                              # DW_AT_external
133bf48b128SDaniel Thornburgh	.byte	25                              # DW_FORM_flag_present
134bf48b128SDaniel Thornburgh	.byte	0                               # EOM(1)
135bf48b128SDaniel Thornburgh	.byte	0                               # EOM(2)
136bf48b128SDaniel Thornburgh	.byte	0                               # EOM(3)
137bf48b128SDaniel Thornburgh	.section	.debug_info,"",@progbits
138bf48b128SDaniel Thornburgh.Lcu_begin0:
139bf48b128SDaniel Thornburgh	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
140bf48b128SDaniel Thornburgh.Ldebug_info_start0:
141bf48b128SDaniel Thornburgh	.short	4                               # DWARF version number
142bf48b128SDaniel Thornburgh	.long	.debug_abbrev                   # Offset Into Abbrev. Section
143bf48b128SDaniel Thornburgh	.byte	8                               # Address Size (in bytes)
144bf48b128SDaniel Thornburgh	.byte	1                               # Abbrev [1] 0xb:0x4a DW_TAG_compile_unit
145bf48b128SDaniel Thornburgh	.long	.Linfo_string0                  # DW_AT_producer
146bf48b128SDaniel Thornburgh	.short	12                              # DW_AT_language
147bf48b128SDaniel Thornburgh	.long	.Linfo_string1                  # DW_AT_name
148bf48b128SDaniel Thornburgh	.long	.Lline_table_start0             # DW_AT_stmt_list
149bf48b128SDaniel Thornburgh	.long	.Linfo_string2                  # DW_AT_comp_dir
150bf48b128SDaniel Thornburgh	.quad	.Lfunc_begin0                   # DW_AT_low_pc
151bf48b128SDaniel Thornburgh	.long	.Lfunc_end1-.Lfunc_begin0       # DW_AT_high_pc
152bf48b128SDaniel Thornburgh	.byte	2                               # Abbrev [2] 0x2a:0x15 DW_TAG_subprogram
153bf48b128SDaniel Thornburgh	.quad	.Lfunc_begin0                   # DW_AT_low_pc
154bf48b128SDaniel Thornburgh	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
155bf48b128SDaniel Thornburgh	.byte	1                               # DW_AT_frame_base
156bf48b128SDaniel Thornburgh	.byte	86
157bf48b128SDaniel Thornburgh	.long	.Linfo_string3                  # DW_AT_name
158bf48b128SDaniel Thornburgh	.byte	1                               # DW_AT_decl_file
159bf48b128SDaniel Thornburgh	.byte	3                               # DW_AT_decl_line
160bf48b128SDaniel Thornburgh                                        # DW_AT_prototyped
161bf48b128SDaniel Thornburgh                                        # DW_AT_external
162bf48b128SDaniel Thornburgh	.byte	2                               # Abbrev [2] 0x3f:0x15 DW_TAG_subprogram
163bf48b128SDaniel Thornburgh	.quad	.Lfunc_begin1                   # DW_AT_low_pc
164bf48b128SDaniel Thornburgh	.long	.Lfunc_end1-.Lfunc_begin1       # DW_AT_high_pc
165bf48b128SDaniel Thornburgh	.byte	1                               # DW_AT_frame_base
166bf48b128SDaniel Thornburgh	.byte	86
167bf48b128SDaniel Thornburgh	.long	.Linfo_string4                  # DW_AT_name
168bf48b128SDaniel Thornburgh	.byte	1                               # DW_AT_decl_file
169bf48b128SDaniel Thornburgh	.byte	7                               # DW_AT_decl_line
170bf48b128SDaniel Thornburgh                                        # DW_AT_prototyped
171bf48b128SDaniel Thornburgh                                        # DW_AT_external
172bf48b128SDaniel Thornburgh	.byte	0                               # End Of Children Mark
173bf48b128SDaniel Thornburgh.Ldebug_info_end0:
174bf48b128SDaniel Thornburgh	.section	.debug_str,"MS",@progbits,1
175bf48b128SDaniel Thornburgh.Linfo_string0:
176bf48b128SDaniel Thornburgh	.asciz	"clang" # string offset=0
177bf48b128SDaniel Thornburgh.Linfo_string1:
178bf48b128SDaniel Thornburgh	.asciz	"tmp.c"                         # string offset=30
179bf48b128SDaniel Thornburgh.Linfo_string2:
180bf48b128SDaniel Thornburgh	.asciz	"/dir" # string offset=36
181bf48b128SDaniel Thornburgh.Linfo_string3:
182bf48b128SDaniel Thornburgh	.asciz	"first"                         # string offset=85
183bf48b128SDaniel Thornburgh.Linfo_string4:
184bf48b128SDaniel Thornburgh	.asciz	"second"                        # string offset=91
185bf48b128SDaniel Thornburgh	.ident	"clang"
186bf48b128SDaniel Thornburgh	.section	".note.GNU-stack","",@progbits
187bf48b128SDaniel Thornburgh	.addrsig
188bf48b128SDaniel Thornburgh	.addrsig_sym first
189bf48b128SDaniel Thornburgh	.addrsig_sym second
190bf48b128SDaniel Thornburgh	.section	.debug_line,"",@progbits
191bf48b128SDaniel Thornburgh.Lline_table_start0:
192