1 # RUN: yaml2obj --docnum=1 %s -o %t.name.o
2 # RUN: llvm-dwarfdump --show-sources %t.name.o | \
3 # RUN: FileCheck --check-prefix=CU-NAME --match-full-lines \
4 # RUN: --implicit-check-not={{.}} %s
7 # CU-NAME-NEXT: second.c
19 Tag: DW_TAG_compile_unit
20 Children: DW_CHILDREN_no
22 - Attribute: DW_AT_name
26 Tag: DW_TAG_compile_unit
27 Children: DW_CHILDREN_no
29 - Attribute: DW_AT_name
43 # RUN: yaml2obj --docnum=2 %s -o %t.comp-dir.o
44 # RUN: llvm-dwarfdump --show-sources %t.comp-dir.o 2>&1 | \
45 # RUN: FileCheck -DFILE=%t.comp-dir.o --check-prefix=CU-COMP-DIR \
46 # RUN: --match-full-lines --implicit-check-not={{.}} %s
48 # CU-COMP-DIR: warning: [[FILE]]: missing name for compilation unit
49 # CU-COMP-DIR-NEXT: warning: [[FILE]]: missing name for compilation unit
61 Tag: DW_TAG_compile_unit
62 Children: DW_CHILDREN_no
64 - Attribute: DW_AT_comp_dir
68 Tag: DW_TAG_compile_unit
69 Children: DW_CHILDREN_no
71 - Attribute: DW_AT_comp_dir
85 # RUN: yaml2obj --docnum=3 \
86 # RUN: -DFIRST_NAME=first.c -DFIRST_COMP_DIR=/comp/first \
87 # RUN: -DSECOND_NAME=second.c -DSECOND_COMP_DIR=/comp/second \
88 # RUN: -o %t.comp-dir-rel-name.o %s
89 # RUN: llvm-dwarfdump --show-sources %t.comp-dir-rel-name.o | \
90 # RUN: FileCheck --check-prefix=CU-COMP-DIR-REL-NAME --match-full-lines \
91 # RUN: --implicit-check-not={{.}} %s
93 # CU-COMP-DIR-REL-NAME: /comp/first[[SEP:[/\\]]]first.c
94 # CU-COMP-DIR-REL-NAME-NEXT: /comp/second[[SEP]]second.c
106 Tag: DW_TAG_compile_unit
107 Children: DW_CHILDREN_no
109 - Attribute: DW_AT_name
111 - Attribute: DW_AT_comp_dir
115 Tag: DW_TAG_compile_unit
116 Children: DW_CHILDREN_no
118 - Attribute: DW_AT_name
120 - Attribute: DW_AT_comp_dir
127 - CStr: [[FIRST_NAME]]
128 - CStr: [[FIRST_COMP_DIR]]
133 - CStr: [[SECOND_NAME]]
134 - CStr: [[SECOND_COMP_DIR]]
136 # RUN: yaml2obj --docnum=3 -o %t.comp-dir-abs-name-posix.o \
137 # RUN: -DFIRST_NAME=/abs/first.c -DFIRST_COMP_DIR=/comp/dir \
138 # RUN: -DSECOND_NAME=/abs/second.c -DSECOND_COMP_DIR=/comp/dir \
140 # RUN: llvm-dwarfdump --show-sources %t.comp-dir-abs-name-posix.o | \
141 # RUN: FileCheck --check-prefix=CU-COMP-DIR-ABS-NAME-POSIX \
142 # RUN: --match-full-lines --implicit-check-not={{.}} %s
144 # CU-COMP-DIR-ABS-NAME-POSIX: /abs/first.c
145 # CU-COMP-DIR-ABS-NAME-POSIX-NEXT: /abs/second.c
147 # RUN: yaml2obj --docnum=3 -o %t.comp-dir-abs-name-windows.o \
148 # RUN: -DFIRST_NAME='C:\abs\first.c' -DFIRST_COMP_DIR='C:\comp\dir' \
149 # RUN: -DSECOND_NAME='C:\abs\second.c' -DSECOND_COMP_DIR='C:\comp\dir' \
151 # RUN: llvm-dwarfdump --show-sources %t.comp-dir-abs-name-windows.o | \
152 # RUN: FileCheck --check-prefix=CU-COMP-DIR-ABS-NAME-WINDOWS \
153 # RUN: --match-full-lines --implicit-check-not={{.}} %s
155 # CU-COMP-DIR-ABS-NAME-WINDOWS: C:\abs\first.c
156 # CU-COMP-DIR-ABS-NAME-WINDOWS-NEXT: C:\abs\second.c
158 # RUN: yaml2obj --docnum=4 %s -o %t.line-table-abs.o
159 # RUN: llvm-dwarfdump --show-sources %t.line-table-abs.o | \
160 # RUN: FileCheck --check-prefix=LINE-TABLE-ABS --match-full-lines \
161 # RUN: --implicit-check-not={{.}} %s
163 # LINE-TABLE-ABS: /comp/first[[SEP:[/\\]]]first.c
164 # LINE-TABLE-ABS-NEXT: /comp/second[[SEP]]second.c
181 IncludeDirs: [/comp/first]
194 IncludeDirs: [/comp/second]
201 # RUN: yaml2obj --docnum=5 %s -o %t.line-table-rel.o
202 # RUN: llvm-dwarfdump --show-sources %t.line-table-rel.o | \
203 # RUN: FileCheck --check-prefix=LINE-TABLE-REL --match-full-lines \
204 # RUN: --implicit-check-not={{.}} %s
206 # LINE-TABLE-REL: first.c
207 # LINE-TABLE-REL-NEXT: second.c
242 # RUN: yaml2obj --docnum=6 %s -o %t.cu-line-table.o
243 # RUN: llvm-dwarfdump --show-sources %t.cu-line-table.o | \
244 # RUN: FileCheck --check-prefix=CU-LINE-TABLE --match-full-lines \
245 # RUN: --implicit-check-not={{.}} %s
247 # CU-LINE-TABLE: /first[[SEP:[/\\]]]first[[SEP]]first.c
248 # CU-LINE-TABLE-NEXT: /second[[SEP]]second[[SEP]]second.c
260 Tag: DW_TAG_compile_unit
261 Children: DW_CHILDREN_no
263 - Attribute: DW_AT_comp_dir
265 - Attribute: DW_AT_stmt_list
266 Form: DW_FORM_sec_offset
269 Tag: DW_TAG_compile_unit
270 Children: DW_CHILDREN_no
272 - Attribute: DW_AT_comp_dir
274 - Attribute: DW_AT_stmt_list
275 Form: DW_FORM_sec_offset
310 IncludeDirs: [second]
317 # RUN: llvm-dwarfdump --show-sources %t.line-table-rel.o %t.cu-line-table.o | \
318 # RUN: FileCheck --check-prefix=MULTIPLE-FILES --match-full-lines \
319 # RUN: --implicit-check-not={{.}} %s
321 # MULTIPLE-FILES: first.c
322 # MULTIPLE-FILES-NEXT: second.c
323 # MULTIPLE-FILES-NEXT: /first[[SEP:[/\\]]]first[[SEP]]first.c
324 # MULTIPLE-FILES-NEXT: /second[[SEP]]second[[SEP]]second.c
326 # RUN: yaml2obj --docnum=7 %s -o %t.no-filenames.o
327 # RUN: llvm-dwarfdump --show-sources %t.no-filenames.o | count 0
346 # TODO: Use yaml2obj for this test once it supports DWARFv5 line tables.
347 # RUN: echo '.file 0 "/dir" "dwarfv5.c"' | \
348 # RUN: llvm-mc -g -dwarf-version=5 -triple x86_64-pc-linux -filetype=obj \
349 # RUN: -o %t.dwarfv5.o
350 # RUN: llvm-dwarfdump --show-sources %t.dwarfv5.o | \
351 # RUN: FileCheck --check-prefix=DWARFV5 --match-full-lines \
352 # RUN: --implicit-check-not={{.}} %s
354 # DWARFV5: /dir{{[/\\]}}dwarfv5.c
356 # RUN: llvm-mc -triple x86_64-pc-linux %S/Inputs/debug_line_malformed.s \
357 # RUN: -filetype=obj -o %t.malformed.o
358 # RUN: not llvm-dwarfdump --show-sources %t.malformed.o 2>&1 | \
359 # RUN: FileCheck --check-prefix=MALFORMED --match-full-lines \
360 # RUN: --implicit-check-not={{.}} %s
362 # MALFORMED: error: parsing line table prologue at offset 0x00000048: unsupported version 0