1 # Demonstrate that -name works with type units.
2 # RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o
3 # RUN: llvm-dwarfdump -name=V4_type_unit -name=V5_split_type_unit %t.o | FileCheck %s
5 # The names should appear twice, once for the unit and once for the type DIE,
6 # because we give them the same name.
9 # CHECK: V5_split_type_unit
10 # CHECK: V5_split_type_unit
12 .section .debug_str,"MS",@progbits,1
16 .section .debug_str.dwo,"MS",@progbits,1
18 .asciz "V5_split_type_unit"
20 # Abbrev section for the normal type unit.
21 .section .debug_abbrev,"",@progbits
22 .byte 0x01 # Abbrev code
23 .byte 0x41 # DW_TAG_type_unit
24 .byte 0x01 # DW_CHILDREN_yes
25 .byte 0x03 # DW_AT_name
26 .byte 0x0e # DW_FORM_strp
29 .byte 0x02 # Abbrev code
30 .byte 0x13 # DW_TAG_structure_type
31 .byte 0x00 # DW_CHILDREN_no (no members)
32 .byte 0x03 # DW_AT_name
33 .byte 0x0e # DW_FORM_strp
38 # And a .dwo copy for the .dwo section.
39 .section .debug_abbrev.dwo,"",@progbits
40 .byte 0x01 # Abbrev code
41 .byte 0x41 # DW_TAG_type_unit
42 .byte 0x01 # DW_CHILDREN_yes
43 .byte 0x03 # DW_AT_name
44 .byte 0x0e # DW_FORM_strp
47 .byte 0x02 # Abbrev code
48 .byte 0x13 # DW_TAG_structure_type
49 .byte 0x00 # DW_CHILDREN_no (no members)
50 .byte 0x03 # DW_AT_name
51 .byte 0x0e # DW_FORM_strp
56 .section .debug_types,"",@progbits
58 # DWARF v4 Type unit header. Normal/split are identical so we do only one.
60 .long TU_4_end-TU_4_version # Length of Unit
62 .short 4 # DWARF version number
63 .long .debug_abbrev # Offset Into Abbrev. Section
64 .byte 8 # Address Size (in bytes)
65 .quad 0x0011223344556677 # Type Signature
66 .long TU_4_type-TU_4_start # Type offset
67 # The type-unit DIE, which has a name.
70 # The type DIE, which has the same name.
78 .section .debug_types.dwo,"",@progbits
79 # FIXME: DWARF v5 wants type units in .debug_info[.dwo] not .debug_types[.dwo].
81 # DWARF v5 split type unit header.
83 .long TU_split_5_end-TU_split_5_version # Length of Unit
85 .short 5 # DWARF version number
86 .byte 6 # DWARF Unit Type
87 .byte 8 # Address Size (in bytes)
88 .long .debug_abbrev.dwo # Offset Into Abbrev. Section
89 .quad 0x8899aabbccddeeff # Type Signature
90 .long TU_split_5_type-TU_split_5_start # Type offset
91 # The type-unit DIE, which has a name.
94 # The type DIE, which has the same name.