1 # REQUIRES: system-linux
3 # RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
4 # RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
5 # RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
6 # RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.exe | FileCheck --check-prefix=PRECHECK %s
7 # RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.bolt | FileCheck --check-prefix=POSTCHECK %s
9 # This test checks that DWARF5 .debug_line is handled correctly.
11 # PRECHECK: version: 5
12 # PRECHECK: include_directories[ 0] = .debug_line_str
13 # PRECHECK-SAME: ] = "."
14 # PRECHECK-NEXT: file_names[ 0]:
15 # PRECHECK-NEXT: name: .debug_line_str
16 # PRECHECK-SAME: = "main.cpp"
17 # PRECHECK-NEXT: dir_index: 0
18 # PRECHECK-NEXT: md5_checksum: bb12fec8d002b1f0e06f7dee4604c6cc
19 # PRECHECK-NOT: file_names[ 1]:
21 # POSTCHECK: version: 5
22 # POSTCHECK: include_directories[ 0] = .debug_line_str
23 # POSTCHECK-SAME: ] = "."
24 # POSTCHECK-NEXT: file_names[ 0]:
25 # POSTCHECK-NEXT: name: .debug_line_str
26 # POSTCHECK-SAME: ] = "main.cpp"
27 # POSTCHECK-NEXT: dir_index: 0
28 # POSTCHECK-NEXT: md5_checksum: bb12fec8d002b1f0e06f7dee4604c6cc
29 # POSTCHECK-NOT: file_names[ 1]:
37 .globl main # -- Begin function main
42 .file 0 "." "main.cpp" md5 0xbb12fec8d002b1f0e06f7dee4604c6cc
43 .loc 0 1 0 # main.cpp:1:0
47 .cfi_def_cfa_offset 16
50 .cfi_def_cfa_register %rbp
53 .loc 0 2 3 prologue_end # main.cpp:2:3
60 .size main, .Lfunc_end0-main
63 .section .debug_abbrev,"",@progbits
64 .byte 1 # Abbreviation Code
65 .byte 17 # DW_TAG_compile_unit
66 .byte 1 # DW_CHILDREN_yes
67 .byte 37 # DW_AT_producer
68 .byte 37 # DW_FORM_strx1
69 .byte 19 # DW_AT_language
70 .byte 5 # DW_FORM_data2
72 .byte 37 # DW_FORM_strx1
73 .byte 114 # DW_AT_str_offsets_base
74 .byte 23 # DW_FORM_sec_offset
75 .byte 16 # DW_AT_stmt_list
76 .byte 23 # DW_FORM_sec_offset
77 .byte 27 # DW_AT_comp_dir
78 .byte 37 # DW_FORM_strx1
79 .byte 17 # DW_AT_low_pc
80 .byte 27 # DW_FORM_addrx
81 .byte 18 # DW_AT_high_pc
82 .byte 6 # DW_FORM_data4
83 .byte 115 # DW_AT_addr_base
84 .byte 23 # DW_FORM_sec_offset
87 .byte 2 # Abbreviation Code
88 .byte 46 # DW_TAG_subprogram
89 .byte 0 # DW_CHILDREN_no
90 .byte 17 # DW_AT_low_pc
91 .byte 27 # DW_FORM_addrx
92 .byte 18 # DW_AT_high_pc
93 .byte 6 # DW_FORM_data4
94 .byte 64 # DW_AT_frame_base
95 .byte 24 # DW_FORM_exprloc
97 .byte 37 # DW_FORM_strx1
98 .byte 58 # DW_AT_decl_file
99 .byte 11 # DW_FORM_data1
100 .byte 59 # DW_AT_decl_line
101 .byte 11 # DW_FORM_data1
102 .byte 73 # DW_AT_type
103 .byte 19 # DW_FORM_ref4
104 .byte 63 # DW_AT_external
105 .byte 25 # DW_FORM_flag_present
108 .byte 3 # Abbreviation Code
109 .byte 36 # DW_TAG_base_type
110 .byte 0 # DW_CHILDREN_no
112 .byte 37 # DW_FORM_strx1
113 .byte 62 # DW_AT_encoding
114 .byte 11 # DW_FORM_data1
115 .byte 11 # DW_AT_byte_size
116 .byte 11 # DW_FORM_data1
120 .section .debug_info,"",@progbits
122 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
124 .short 5 # DWARF version number
125 .byte 1 # DWARF Unit Type
126 .byte 8 # Address Size (in bytes)
127 .long .debug_abbrev # Offset Into Abbrev. Section
128 .byte 1 # Abbrev [1] 0xc:0x2b DW_TAG_compile_unit
129 .byte 0 # DW_AT_producer
130 .short 33 # DW_AT_language
132 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
133 .long .Lline_table_start0 # DW_AT_stmt_list
134 .byte 2 # DW_AT_comp_dir
135 .byte 0 # DW_AT_low_pc
136 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
137 .long .Laddr_table_base0 # DW_AT_addr_base
138 .byte 2 # Abbrev [2] 0x23:0xf DW_TAG_subprogram
139 .byte 0 # DW_AT_low_pc
140 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
141 .byte 1 # DW_AT_frame_base
144 .byte 0 # DW_AT_decl_file
145 .byte 1 # DW_AT_decl_line
146 .long 50 # DW_AT_type
148 .byte 3 # Abbrev [3] 0x32:0x4 DW_TAG_base_type
150 .byte 5 # DW_AT_encoding
151 .byte 4 # DW_AT_byte_size
152 .byte 0 # End Of Children Mark
154 .section .debug_str_offsets,"",@progbits
155 .long 24 # Length of String Offsets Set
159 .section .debug_str,"MS",@progbits,1
161 .asciz "clang version 15.0.0" # string offset=0
163 .asciz "main.cpp" # string offset=134
165 .asciz "." # string offset=143
167 .asciz "main" # string offset=180
169 .asciz "int" # string offset=185
170 .section .debug_str_offsets,"",@progbits
176 .section .debug_addr,"",@progbits
177 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
179 .short 5 # DWARF version number
180 .byte 8 # Address size
181 .byte 0 # Segment selector size
185 .ident "clang version 15.0.0"
186 .section ".note.GNU-stack","",@progbits
188 .section .debug_line,"",@progbits