2121# SHDR-NEXT: AddressAlignment: [[ADDRALIGN]]
2222# SHDR-NEXT: EntrySize: 0
2323# DWARF32-LE-CONTENT-NEXT: SectionData (
24- # DWARF32-LE-CONTENT-NEXT: 0000: 34120000 05000204 34120000 01785634
24+ # DWARF32-LE-CONTENT-NEXT: 0000: 34120000 05000304 34120000 01785634
2525# # ^------- unit_length (4-byte)
2626# # ^--- version (2-byte)
2727# # ^- unit_type (1-byte) DW_UT_type
@@ -208,7 +208,7 @@ DWARF:
208208 debug_info :
209209 - Length : 0x1234
210210 Version : 5
211- UnitType : DW_UT_type
211+ UnitType : DW_UT_partial
212212 AbbrOffset : 0x1234
213213 AddrSize : 4
214214 Entries :
@@ -297,7 +297,7 @@ DWARF:
297297# RUN: FileCheck -DINDEX=2 -DNAME=15 -DOFFSET=0x9B -DSIZE=179 -DADDRALIGN=1 %s --check-prefixes=SHDR,DWARF32-BE-CONTENT
298298
299299# DWARF32-BE-CONTENT-NEXT: SectionData (
300- # DWARF32-BE-CONTENT-NEXT: 0000: 00001234 00050204 00001234 01123456
300+ # DWARF32-BE-CONTENT-NEXT: 0000: 00001234 00050304 00001234 01123456
301301# # ^------- unit_length (4-byte)
302302# # ^--- version (2-byte)
303303# # ^- unit_type (1-byte) DW_UT_type
@@ -449,7 +449,7 @@ DWARF:
449449 debug_info :
450450 - Length : 0x1234
451451 Version : 5
452- UnitType : DW_UT_type
452+ UnitType : DW_UT_compile
453453 AbbrOffset : 0x1234
454454 Entries : []
455455
@@ -476,7 +476,7 @@ DWARF:
476476 debug_info :
477477 - Length : 0x1234
478478 Version : 5
479- UnitType : DW_UT_type
479+ UnitType : DW_UT_compile
480480 AbbrOffset : 0x1234
481481 Entries : []
482482
@@ -541,7 +541,7 @@ DWARF:
541541 debug_info :
542542 - Length : 0x1234
543543 Version : 5
544- UnitType : DW_UT_type
544+ UnitType : DW_UT_compile
545545 AbbrOffset : 0x1234
546546 Entries :
547547 - AbbrCode : 0
@@ -554,7 +554,7 @@ DWARF:
554554# RUN: FileCheck %s --check-prefix=EMPTY-ENTRIES --match-full-lines
555555
556556# EMPTY-ENTRIES: Hex dump of section '.debug_info':
557- # EMPTY-ENTRIES-NEXT: 0x00000000 34120000 05000204 34120000 4.......4...
557+ # EMPTY-ENTRIES-NEXT: 0x00000000 34120000 05000104 34120000 4.......4...
558558# EMPTY-ENTRIES-EMPTY:
559559# # ^- 'Entries' is empty
560560
@@ -567,7 +567,7 @@ DWARF:
567567 debug_info :
568568 - Length : 0x1234
569569 Version : 5
570- UnitType : DW_UT_type
570+ UnitType : DW_UT_compile
571571 AbbrOffset : 0x1234
572572 Entries : []
573573
@@ -579,7 +579,7 @@ DWARF:
579579# RUN: FileCheck %s --check-prefix=FORM --match-full-lines
580580
581581# FORM: Hex dump of section '.debug_info':
582- # FORM-NEXT: 0x00000000 34120000 05000204 34120000 02341221 4.......4....4.!
582+ # FORM-NEXT: 0x00000000 34120000 05000104 34120000 02341221 4.......4....4.!
583583# # ^------- unit_length (4-byte)
584584# # ^- abbreviation code (ULEB128)
585585# # ^--- Form: DW_FORM_data2 (2-byte)
@@ -617,7 +617,7 @@ DWARF:
617617 debug_info :
618618 - Length : 0x1234
619619 Version : 5
620- UnitType : DW_UT_type
620+ UnitType : DW_UT_compile
621621 AbbrOffset : 0x1234
622622 Entries :
623623 # # Test that yaml2obj emits values when the abbrev code is specified.
@@ -655,29 +655,58 @@ DWARF:
655655 debug_info :
656656 - Length : 0x1234
657657 Version : 5
658- UnitType : DW_UT_type
658+ UnitType : DW_UT_compile
659659 AbbrOffset : 0x1234
660660 Entries :
661661 - AbbrCode : 1
662662 Values :
663663 - Value : 0x1234
664664
665- # # j) Test that yaml2obj emits the correct DWARF64 unit headers.
666-
667- # # DWARFv5 unit header.
665+ # # j) Test that yaml2obj emits the correct DWARFv5 unit headers.
668666
669667# RUN: yaml2obj --docnum=11 %s -o %t11.o
670668# RUN: llvm-readelf --hex-dump=.debug_info %t11.o | \
671669# RUN: FileCheck %s --check-prefix=DWARFV5-HEADER
672670
673671# DWARFV5-HEADER: Hex dump of section '.debug_info':
674- # DWARFV5-HEADER-NEXT: 0x00000000 ffffffff 0c000000 00000000 05000208 ................
672+ # DWARFV5-HEADER-NEXT: 0x00000000 ffffffff 0d000000 00000000 05000108 ................
675673# # ^------------------------- unit_length (12-byte)
676674# # ^--- version (2-byte)
677675# # ^- unit_type (1-byte)
678676# # ^- address_size (1-byte)
679- # DWARFV5-HEADER-NEXT: 0x00000010 34120000 00000000 4 .......
677+ # DWARFV5-HEADER-NEXT: 0x00000010 34120000 00000000 00150000 00050002 4........ .......
680678# # ^---------------- debug_abbrev_offset (8-byte)
679+ # # ^- End of children (1-byte)
680+ # # ^-------- unit_length (4-byte)
681+ # # ^--- version (2-byte)
682+ # # ^- unit_type (1-byte)
683+ # DWARFV5-HEADER-NEXT: 0x00000020 08341200 000df0ad baefbead de180000 .4..............
684+ # # ^- address_size (1-byte)
685+ # # ^-------- debug_abbrev_offset (4-byte)
686+ # # ^----------------- type_signature (8-byte)
687+ # # \/ ^----- type_offset (4-byte)
688+ # DWARFV5-HEADER-NEXT: 0x00000030 0000ffff ffff1d00 00000000 00000500 ................
689+ # # ^- End of children (1-byte)
690+ # # ^-------------------------- unit_length (12-byte)
691+ # # ^--- version (2-byte)
692+ # DWARFV5-HEADER-NEXT: 0x00000040 02083412 00000000 00000df0 adbaefbe ..4.............
693+ # # ^- unit_type (1-byte)
694+ # # ^- address_size (1-byte)
695+ # # ^----------------- debug_abbrev_offset (8-byte)
696+ # # \/-- ^------------ type_signature (8-byte)
697+ # DWARFV5-HEADER-NEXT: 0x00000050 adde2800 00000000 00000011 00000005 ..(.............
698+ # # ^----------------- type_offset (8-byte)
699+ # # ^- End of children (1-byte)
700+ # # ^-------- unit_length (4-byte)
701+ # # \/ ^- version (2-byte)
702+ # DWARFV5-HEADER-NEXT: 0x00000060 00040834 1200000d f0adbaef beadde00 ...4............
703+ # # ^- unit_type (1-byte)
704+ # # ^- address_size (1-byte)
705+ # # ^-------- debug_abbrev_offset (4-byte)
706+ # # ^----------------- type_signature (8-byte)
707+ # # ^- End of children (1-byte)
708+
709+
681710
682711--- !ELF
683712FileHeader :
@@ -686,12 +715,33 @@ FileHeader:
686715 Type : ET_EXEC
687716DWARF :
688717 debug_info :
718+ - Format : DWARF64
719+ Version : 5
720+ UnitType : DW_UT_compile
721+ AbbrOffset : 0x1234
722+ Entries :
723+ - AbbrCode : 0
724+ - Version : 5
725+ UnitType : DW_UT_type
726+ AbbrOffset : 0x1234
727+ TypeSignature : 0xdeadbeefbaadf00d
728+ TypeOffset : 24
729+ Entries :
730+ - AbbrCode : 0
689731 - Format : DWARF64
690- Length : 0x0c
691- Version : 5
692- UnitType : DW_UT_type
693- AbbrOffset : 0x1234
694- Entries : []
732+ Version : 5
733+ UnitType : DW_UT_type
734+ AbbrOffset : 0x1234
735+ TypeSignature : 0xdeadbeefbaadf00d
736+ TypeOffset : 40
737+ Entries :
738+ - AbbrCode : 0
739+ - Version : 5
740+ UnitType : DW_UT_skeleton
741+ AbbrOffset : 0x1234
742+ DwoID : 0xdeadbeefbaadf00d
743+ Entries :
744+ - AbbrCode : 0
695745
696746# # DWARFv4 unit header.
697747
0 commit comments