1 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
2 # RUN: | not llvm-dwarfdump -v -verify - \
5 # CHECK: error: DIE has invalid DW_AT_stmt_list encoding:{{[[:space:]]}}
6 # CHECK-NEXT: 0x0000000c: DW_TAG_compile_unit [1] *
7 # CHECK-NEXT: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 5.0.0 (trunk 308185) (llvm/trunk 308186)")
8 # CHECK-NEXT: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
9 # CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000037] = "basic.c")
10 # CHECK-NEXT: DW_AT_stmt_list [DW_FORM_block4]
11 # CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000003f] = "/Users/sgravani/Development/tests")
12 # CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
13 # CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000016){{[[:space:]]}}
14 # CHECK-NEXT: error: DIE has DW_AT_type with incompatible tag DW_TAG_null{{[[:space:]]}}
15 # CHECK-NEXT: 0x0000002b: DW_TAG_subprogram [2] *
16 # CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
17 # CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000016)
18 # CHECK-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6)
19 # CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000061] = "main")
20 # CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)
21 # CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (1)
22 # CHECK-NEXT: DW_AT_prototyped [DW_FORM_flag_present] (true)
23 # CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0052 => {0x00000052} "")
24 # CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true){{[[:space:]]}}
25 # CHECK-NEXT: error: Compilation unit root DIE is not a unit DIE: DW_TAG_null.
26 # CHECK-NEXT: error: Compilation unit type (DW_UT_compile) and root DIE (DW_TAG_null) do not match.
27 # CHECK-NEXT: error: Units[2] - start offset: 0x00000068
28 # CHECK-NEXT: note: The length for this unit is too large for the .debug_info provided.
29 # CHECK-NEXT: note: The unit type encoding is not valid.
32 .section __TEXT,__text,regular,pure_instructions
33 .globl _main ## -- Begin function main
38 .loc 1 1 0 ## basic.c:1:0
42 .cfi_def_cfa_offset 16
45 .cfi_def_cfa_register %rbp
49 .loc 1 2 7 prologue_end ## basic.c:2:7
51 .loc 1 3 3 ## basic.c:3:3
58 .section __DWARF,__debug_str,regular,debug
60 .asciz "clang version 5.0.0 (trunk 308185) (llvm/trunk 308186)" ## string offset=0
61 .asciz "basic.c" ## string offset=55
62 .asciz "/Users/sgravani/Development/tests" ## string offset=63
63 .asciz "main" ## string offset=97
64 .asciz "int" ## string offset=102
65 .asciz "a" ## string offset=106
66 .section __DWARF,__debug_abbrev,regular,debug
68 .byte 1 ## Abbreviation Code
69 .byte 17 ## DW_TAG_compile_unit
70 .byte 1 ## DW_CHILDREN_yes
71 .byte 37 ## DW_AT_producer
72 .byte 14 ## DW_FORM_strp
73 .byte 19 ## DW_AT_language
74 .byte 5 ## DW_FORM_data2
76 .byte 14 ## DW_FORM_strp
77 .byte 16 ## DW_AT_stmt_list
78 .byte 4 ## DW_FORM_sec_offset -- error: DIE has invalid DW_AT_stmt_list encoding:
79 .byte 27 ## DW_AT_comp_dir
80 .byte 14 ## DW_FORM_strp
81 .byte 17 ## DW_AT_low_pc
82 .byte 1 ## DW_FORM_addr
83 .byte 18 ## DW_AT_high_pc
84 .byte 6 ## DW_FORM_data4
87 .byte 2 ## Abbreviation Code
88 .byte 46 ## DW_TAG_subprogram
89 .byte 1 ## DW_CHILDREN_yes
90 .byte 17 ## DW_AT_low_pc
91 .byte 1 ## DW_FORM_addr
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 14 ## DW_FORM_strp
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 39 ## DW_AT_prototyped
103 .byte 25 ## DW_FORM_flag_present
104 .byte 73 ## DW_AT_type
105 .byte 19 ## DW_FORM_ref4
106 .byte 63 ## DW_AT_external
107 .byte 25 ## DW_FORM_flag_present
110 .byte 3 ## Abbreviation Code
111 .byte 52 ## DW_TAG_variable
112 .byte 0 ## DW_CHILDREN_no
113 .byte 2 ## DW_AT_location
114 .byte 24 ## DW_FORM_exprloc
115 .byte 3 ## DW_AT_name
116 .byte 14 ## DW_FORM_strp
117 .byte 58 ## DW_AT_decl_file
118 .byte 11 ## DW_FORM_data1
119 .byte 59 ## DW_AT_decl_line
120 .byte 11 ## DW_FORM_data1
121 .byte 74 ## DW_AT_type
122 .byte 19 ## DW_FORM_ref4
125 .byte 4 ## Abbreviation Code
126 .byte 36 ## DW_TAG_base_type
127 .byte 0 ## DW_CHILDREN_no
128 .byte 3 ## DW_AT_name
129 .byte 14 ## DW_FORM_strp
130 .byte 62 ## DW_AT_encoding
131 .byte 11 ## DW_FORM_data1
132 .byte 11 ## DW_AT_byte_size
133 .byte 11 ## DW_FORM_data1
137 .section __DWARF,__debug_info,regular,debug
140 .long 87 ## Length of Unit
141 .short 5 ## DWARF version number
142 .byte 1 ## DWARF Unit Type
143 .byte 8 ## Address Size (in bytes)
144 Lset0
= Lsection_abbrev-Lsection_abbrev
## Offset Into Abbrev. Section
146 .byte 1 ## Abbrev [1] 0xc:0x4f DW_TAG_compile_unit
147 .long 0 ## DW_AT_producer
148 .short 12 ## DW_AT_language
149 .long 55 ## DW_AT_name
150 Lset1
= Lline_table_start0-Lsection_line
## DW_AT_stmt_list
152 .long 63 ## DW_AT_comp_dir
153 .quad Lfunc_begin0 ## DW_AT_low_pc
154 Lset2
= Lfunc_end0-Lfunc_begin0
## DW_AT_high_pc
156 .byte 2 ## Abbrev [2] 0x2b:0x28 DW_TAG_subprogram
157 .quad Lfunc_begin0 ## DW_AT_low_pc
158 Lset3
= Lfunc_end0-Lfunc_begin0
## DW_AT_high_pc
160 .byte 1 ## DW_AT_frame_base
162 .long 97 ## DW_AT_name
163 .byte 1 ## DW_AT_decl_file
164 .byte 1 ## DW_AT_decl_line
166 .long 82 ## DW_AT_type
168 .byte 3 ## Abbrev [3] 0x44:0xe DW_TAG_variable
169 .byte 2 ## DW_AT_location
172 .long 106 ## DW_AT_name
173 .byte 1 ## DW_AT_decl_file
174 .byte 2 ## DW_AT_decl_line
175 .long 83 ## DW_AT_type
176 .byte 0 ## End Of Children Mark
177 .byte 4 ## Abbrev [4] 0x53:0x7 DW_TAG_base_type
178 .long 102 ## DW_AT_name
179 .byte 5 ## DW_AT_encoding
180 .byte 4 ## DW_AT_byte_size
181 .byte 0 ## End Of Children Mark
183 .long 9 ## Length of Unit
184 .short 5 ## DWARF version number
185 .byte 1 ## DWARF Unit Type
186 .byte 4 ## Address Size (in bytes)
187 .long 0 ## Abbrev offset
190 .long 26 ## Length of Unit -- Error: The length for this unit is too large for the .debug_info provided.
191 .short 5 ## DWARF version number
192 .byte 0 ## DWARF Unit Type
193 .byte 4 ## Address Size (in bytes)
199 .subsections_via_symbols
200 .section __DWARF,__debug_line,regular,debug