1 # Test object to verify dwarfdump handles a DWARF-64 v5 line header.
2 # FIXME: Make the other headers DWARF-64 also.
3 # FIXME: Add variants for earlier DWARF versions.
5 # RUN: llvm-mc -triple x86_64-unknown-linux --defsym ELF=0 \
6 # RUN: -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s
8 # RUN: llvm-mc -triple x86_64-apple-darwin --defsym MACHO=0 \
9 # RUN: -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s
12 .section .debug_str,"MS",@progbits,1
15 .section __DWARF,__debug_str,regular,debug
18 .asciz "Handmade DWARF producer"
20 .asciz "V5_compile_unit"
27 .section .debug_abbrev,"",@progbits
30 .section __DWARF,__debug_abbrev,regular,debug
33 .byte 0x01 # Abbrev code
34 .byte 0x11 # DW_TAG_compile_unit
35 .byte 0x00 # DW_CHILDREN_no
36 .byte 0x25 # DW_AT_producer
37 .byte 0x0e # DW_FORM_strp
38 .byte 0x03 # DW_AT_name
39 .byte 0x0e # DW_FORM_strp
40 .byte 0x10 # DW_AT_stmt_list
41 .byte 0x17 # DW_FORM_sec_offset
46 .section .debug_info,"",@progbits
49 .section __DWARF,__debug_info,regular,debug
52 # DWARF-32 v5 normal CU header.
53 Lset0
= CU_5_end-CU_5_version
# Length of Unit
56 .short 5 # DWARF version number
57 .byte 1 # DWARF Unit Type
58 .byte 8 # Address Size (in bytes)
60 .long abbrev # Offset Into Abbrev. Section
65 # The compile-unit DIE, with DW_AT_producer, DW_AT_name, DW_AT_stmt_list.
78 # CHECK-LABEL: .debug_info contents:
79 # CHECK: 0x00000000: Compile Unit: length = 0x00000016 version = 0x0005 unit_type = DW_UT_compile abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x0000001a)
80 # CHECK: 0x0000000c: DW_TAG_compile_unit
81 # CHECK-NEXT: DW_AT_producer {{.*}} "Handmade DWARF producer"
82 # CHECK-NEXT: DW_AT_name {{.*}} "V5_compile_unit"
83 # CHECK-NEXT: DW_AT_stmt_list {{.*}} (0x00000000)
86 .section .debug_line,"",@progbits
89 .section __DWARF,__debug_line,regular,debug
92 # DWARF-64 v5 line-table header.
95 Lset1
= LH_5_end-LH_5_version
# Length of Unit
98 .short 5 # DWARF version number
99 .byte 8 # Address Size
100 .byte 0 # Segment Selector Size
101 Lset2
= LH_5_header_end-LH_5_params
# Length of Prologue
104 .byte 1 # Minimum Instruction Length
105 .byte 1 # Maximum Operations per Instruction
106 .byte 1 # Default is_stmt
108 .byte 14 # Line Range
109 .byte 13 # Opcode Base
110 .byte 0 # Standard Opcode Lengths
122 # Directory table format
123 .byte 1 # One element per directory entry
124 .byte 1 # DW_LNCT_path
125 .byte 0x0e # DW_FORM_strp (-> .debug_str)
126 # Directory table entries
127 .byte 2 # Two directories
131 .byte 4 # Four elements per file entry
132 .byte 1 # DW_LNCT_path
133 .byte 0x08 # DW_FORM_string
134 .byte 2 # DW_LNCT_directory_index
135 .byte 0x0b # DW_FORM_data1
136 .byte 3 # DW_LNCT_timestamp
137 .byte 0x0f # DW_FORM_udata
138 .byte 4 # DW_LNCT_size
139 .byte 0x0f # DW_FORM_udata
151 # Line number program, which is empty.
154 # CHECK-LABEL: .debug_line contents:
155 # CHECK: Line table prologue:
156 # CHECK: total_length: 0x00000050
158 # CHECK: address_size: 8
159 # CHECK: seg_select_size: 0
160 # CHECK: prologue_length: 0x00000044
161 # CHECK: max_ops_per_inst: 1
162 # CHECK: include_directories[ 0] = .debug_str[0x00000028] = "Directory5a"
163 # CHECK: include_directories[ 1] = .debug_str[0x00000034] = "Directory5b"
164 # CHECK-NOT: include_directories
165 # CHECK: file_names[ 0]:
166 # CHECK-NEXT: name: "File5a"
167 # CHECK-NEXT: dir_index: 0
168 # CHECK-NEXT: mod_time: 0x00000051
169 # CHECK-NEXT: length: 0x00000052
170 # CHECK: file_names[ 1]:
171 # CHECK-NEXT: name: "File5b"
172 # CHECK-NEXT: dir_index: 1
173 # CHECK-NEXT: mod_time: 0x00000053
174 # CHECK-NEXT: length: 0x00000054
175 # CHECK-NOT: file_names