1 ## a) Test that yaml2obj is able to emit the __debug_abbrev section and obj2yaml is
2 ## able to convert it back.
4 # RUN: yaml2obj --docnum=1 %s | obj2yaml | FileCheck %s
10 cpusubtype: 0x00000003
42 addr: 0x0000000100000F50
54 addr: 0x0000000100000F84
64 - sectname: __stub_helper
66 addr: 0x0000000100000F8C
78 addr: 0x0000000100000FA6
88 - sectname: __unwind_info
90 addr: 0x0000000100000FB4
112 - sectname: __nl_symbol_ptr
114 addr: 0x0000000100001000
121 reserved1: 0x00000001
122 reserved2: 0x00000000
123 reserved3: 0x00000000
124 - sectname: __la_symbol_ptr
126 addr: 0x0000000100001010
133 reserved1: 0x00000003
134 reserved2: 0x00000000
135 reserved3: 0x00000000
159 - sectname: __debug_line
161 addr: 0x0000000100003000
168 reserved1: 0x00000000
169 reserved2: 0x00000000
170 reserved3: 0x00000000
171 - sectname: __debug_pubnames
173 addr: 0x0000000100003045
180 reserved1: 0x00000000
181 reserved2: 0x00000000
182 reserved3: 0x00000000
183 - sectname: __debug_pubtypes
185 addr: 0x0000000100003060
192 reserved1: 0x00000000
193 reserved2: 0x00000000
194 reserved3: 0x00000000
195 - sectname: __debug_info
197 addr: 0x00000001000030B3
204 reserved1: 0x00000000
205 reserved2: 0x00000000
206 reserved3: 0x00000000
207 - sectname: __debug_abbrev
209 addr: 0x000000010000312C
216 reserved1: 0x00000000
217 reserved2: 0x00000000
218 reserved3: 0x00000000
219 - sectname: __debug_str
221 addr: 0x0000000100003178
228 reserved1: 0x00000000
229 reserved2: 0x00000000
230 reserved3: 0x00000000
231 - sectname: __apple_names
233 addr: 0x0000000100003206
240 reserved1: 0x00000000
241 reserved2: 0x00000000
242 reserved3: 0x00000000
243 - sectname: __apple_namespac
245 addr: 0x0000000100003242
252 reserved1: 0x00000000
253 reserved2: 0x00000000
254 reserved3: 0x00000000
255 - sectname: __apple_types
257 addr: 0x0000000100003266
264 reserved1: 0x00000000
265 reserved2: 0x00000000
266 reserved3: 0x00000000
267 - sectname: __apple_objc
269 addr: 0x00000001000032D8
276 reserved1: 0x00000000
277 reserved2: 0x00000000
278 reserved3: 0x00000000
283 Tag: DW_TAG_compile_unit
284 Children: DW_CHILDREN_yes
286 - Attribute: DW_AT_producer
288 - Attribute: DW_AT_language
290 - Attribute: DW_AT_name
292 - Attribute: DW_AT_stmt_list
293 Form: DW_FORM_sec_offset
294 - Attribute: DW_AT_comp_dir
296 - Attribute: DW_AT_low_pc
298 - Attribute: DW_AT_high_pc
301 Tag: DW_TAG_subprogram
302 Children: DW_CHILDREN_yes
304 - Attribute: DW_AT_low_pc
306 - Attribute: DW_AT_high_pc
308 - Attribute: DW_AT_frame_base
309 Form: DW_FORM_exprloc
310 - Attribute: DW_AT_name
312 - Attribute: DW_AT_decl_file
314 - Attribute: DW_AT_decl_line
316 - Attribute: DW_AT_prototyped
317 Form: DW_FORM_flag_present
318 - Attribute: DW_AT_type
320 - Attribute: DW_AT_external
321 Form: DW_FORM_flag_present
323 Tag: DW_TAG_formal_parameter
324 Children: DW_CHILDREN_no
326 - Attribute: DW_AT_location
327 Form: DW_FORM_exprloc
328 - Attribute: DW_AT_name
330 - Attribute: DW_AT_decl_file
332 - Attribute: DW_AT_decl_line
334 - Attribute: DW_AT_type
337 Tag: DW_TAG_base_type
338 Children: DW_CHILDREN_no
340 - Attribute: DW_AT_name
342 - Attribute: DW_AT_encoding
344 - Attribute: DW_AT_byte_size
347 Tag: DW_TAG_pointer_type
348 Children: DW_CHILDREN_no
350 - Attribute: DW_AT_type
355 #CHECK: debug_abbrev:
357 #CHECK: Tag: DW_TAG_compile_unit
358 #CHECK: Children: DW_CHILDREN_yes
360 #CHECK: - Attribute: DW_AT_producer
361 #CHECK: Form: DW_FORM_strp
362 #CHECK: - Attribute: DW_AT_language
363 #CHECK: Form: DW_FORM_data2
364 #CHECK: - Attribute: DW_AT_name
365 #CHECK: Form: DW_FORM_strp
366 #CHECK: - Attribute: DW_AT_stmt_list
367 #CHECK: Form: DW_FORM_sec_offset
368 #CHECK: - Attribute: DW_AT_comp_dir
369 #CHECK: Form: DW_FORM_strp
370 #CHECK: - Attribute: DW_AT_low_pc
371 #CHECK: Form: DW_FORM_addr
372 #CHECK: - Attribute: DW_AT_high_pc
373 #CHECK: Form: DW_FORM_data4
375 #CHECK: Tag: DW_TAG_subprogram
376 #CHECK: Children: DW_CHILDREN_yes
378 #CHECK: - Attribute: DW_AT_low_pc
379 #CHECK: Form: DW_FORM_addr
380 #CHECK: - Attribute: DW_AT_high_pc
381 #CHECK: Form: DW_FORM_data4
382 #CHECK: - Attribute: DW_AT_frame_base
383 #CHECK: Form: DW_FORM_exprloc
384 #CHECK: - Attribute: DW_AT_name
385 #CHECK: Form: DW_FORM_strp
386 #CHECK: - Attribute: DW_AT_decl_file
387 #CHECK: Form: DW_FORM_data1
388 #CHECK: - Attribute: DW_AT_decl_line
389 #CHECK: Form: DW_FORM_data1
390 #CHECK: - Attribute: DW_AT_prototyped
391 #CHECK: Form: DW_FORM_flag_present
392 #CHECK: - Attribute: DW_AT_type
393 #CHECK: Form: DW_FORM_ref4
394 #CHECK: - Attribute: DW_AT_external
395 #CHECK: Form: DW_FORM_flag_present
397 #CHECK: Tag: DW_TAG_formal_parameter
398 #CHECK: Children: DW_CHILDREN_no
400 #CHECK: - Attribute: DW_AT_location
401 #CHECK: Form: DW_FORM_exprloc
402 #CHECK: - Attribute: DW_AT_name
403 #CHECK: Form: DW_FORM_strp
404 #CHECK: - Attribute: DW_AT_decl_file
405 #CHECK: Form: DW_FORM_data1
406 #CHECK: - Attribute: DW_AT_decl_line
407 #CHECK: Form: DW_FORM_data1
408 #CHECK: - Attribute: DW_AT_type
409 #CHECK: Form: DW_FORM_ref4
411 #CHECK: Tag: DW_TAG_base_type
412 #CHECK: Children: DW_CHILDREN_no
414 #CHECK: - Attribute: DW_AT_name
415 #CHECK: Form: DW_FORM_strp
416 #CHECK: - Attribute: DW_AT_encoding
417 #CHECK: Form: DW_FORM_data1
418 #CHECK: - Attribute: DW_AT_byte_size
419 #CHECK: Form: DW_FORM_data1
421 #CHECK: Tag: DW_TAG_pointer_type
422 #CHECK: Children: DW_CHILDREN_no
424 #CHECK: - Attribute: DW_AT_type
425 #CHECK: Form: DW_FORM_ref4
427 ## b) Test that yaml2obj emits an error message when there are non-empty compilation
428 ## units and multiple abbrev tables are assigned the same ID.
430 # RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --check-prefix=ID-COLLISION
432 # ID-COLLISION: yaml2obj: error: the ID (1) of abbrev table with index 1 has been used by abbrev table with index 0
438 cpusubtype: 0x00000003
457 - sectname: __debug_abbrev
466 reserved1: 0x00000000
467 reserved2: 0x00000000
468 reserved3: 0x00000000
469 - sectname: __debug_info
478 reserved1: 0x00000000
479 reserved2: 0x00000000
480 reserved3: 0x00000000