1 # This test checks if we can correctly parse manull cu and tu index for DWARF5.
3 # RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o \
4 # RUN: -split-dwarf-file=%t.dwo -dwarf-version=5
5 # RUN: llvm-dwp %t.dwo -o %t.dwp
6 # RUN: llvm-dwarfdump -debug-info -debug-cu-index -debug-tu-index %t.dwp | FileCheck %s
7 # RUN: llvm-dwarfdump -debug-info -debug-cu-index -debug-tu-index -manaully-generate-unit-index %t.dwp | FileCheck %s
9 ## Note: In order to check whether the type unit index is generated
10 ## there is no need to add the missing DIEs for the structure type of the type unit.
12 # CHECK-DAG: .debug_info.dwo contents:
13 # CHECK: 0x00000000: Type Unit: length = 0x00000017, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_type, abbr_offset = 0x0000, addr_size = 0x08, name = '', type_signature = [[TUID1:.*]], type_offset = 0x0019 (next unit at 0x0000001b)
14 # CHECK: 0x0000001b: Type Unit: length = 0x00000017, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_type, abbr_offset = 0x0000, addr_size = 0x08, name = '', type_signature = [[TUID2:.*]], type_offset = 0x0019 (next unit at 0x00000036)
15 # CHECK: 0x00000036: Compile Unit: length = 0x00000011, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset = 0x0000, addr_size = 0x08, DWO_id = [[CUID1:.*]] (next unit at 0x0000004b)
16 # CHECK-DAG: .debug_cu_index contents:
17 # CHECK: version = 5, units = 1, slots = 2
18 # CHECK: Index Signature INFO ABBREV
19 # CHECK: 1 [[CUID1]] [0x0000000000000036, 0x000000000000004b) [0x00000000, 0x00000010)
20 # CHECK-DAG: .debug_tu_index contents:
21 # CHECK: version = 5, units = 2, slots = 4
22 # CHECK: Index Signature INFO ABBREV
23 # CHECK: 1 [[TUID1]] [0x0000000000000000, 0x000000000000001b) [0x00000000, 0x00000010)
24 # CHECK: 4 [[TUID2]] [0x000000000000001b, 0x0000000000000036) [0x00000000, 0x00000010)
26 .section .debug_info.dwo,"e",@progbits
27 .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
28 .Ldebug_info_dwo_start0:
29 .short 5 # DWARF version number
30 .byte 6 # DWARF Unit Type (DW_UT_split_type)
31 .byte 8 # Address Size (in bytes)
32 .long 0 # Offset Into Abbrev. Section
33 .quad 5657452045627120676 # Type Signature
34 .long 25 # Type DIE Offset
35 .byte 2 # Abbrev [2] DW_TAG_type_unit
36 .byte 3 # Abbrev [3] DW_TAG_structure_type
37 .byte 0 # End Of Children Mark
38 .Ldebug_info_dwo_end0:
39 .section .debug_info.dwo,"e",@progbits
40 .long .Ldebug_info_dwo_end1-.Ldebug_info_dwo_start1 # Length of Unit
41 .Ldebug_info_dwo_start1:
42 .short 5 # DWARF version number
43 .byte 6 # DWARF Unit Type (DW_UT_split_type)
44 .byte 8 # Address Size (in bytes)
45 .long 0 # Offset Into Abbrev. Section
46 .quad -8528522068957683993 # Type Signature
47 .long 25 # Type DIE Offset
48 .byte 4 # Abbrev [4] DW_TAG_type_unit
49 .byte 5 # Abbrev [5] DW_TAG_structure_type
50 .byte 0 # End Of Children Mark
51 .Ldebug_info_dwo_end1:
52 .section .debug_info.dwo,"e",@progbits
53 .long .Ldebug_info_dwo_end2-.Ldebug_info_dwo_start2 # Length of Unit
54 .Ldebug_info_dwo_start2:
55 .short 5 # DWARF version number
56 .byte 5 # DWARF Unit Type (DW_UT_split_compile)
57 .byte 8 # Address Size (in bytes)
58 .long 0 # Offset Into Abbrev. Section
59 .quad 1152943841751211454
60 .byte 1 # Abbrev [1] DW_TAG_compile_unit
61 .Ldebug_info_dwo_end2:
62 .section .debug_abbrev.dwo,"e",@progbits
63 .byte 1 # Abbreviation Code
64 .byte 17 # DW_TAG_compile_unit
65 .byte 0 # DW_CHILDREN_no
68 .byte 2 # Abbreviation Code
69 .byte 65 # DW_TAG_type_unit
70 .byte 1 # DW_CHILDREN_yes
73 .byte 4 # Abbreviation Code
74 .byte 65 # DW_TAG_type_unit
75 .byte 1 # DW_CHILDREN_yes