xref: /llvm-project/llvm/test/tools/llvm-dwp/X86/cu_and_tu_info_section_v5.s (revision 316da543af14fb4b40ef0377fe770f430745f5ea)
1# This test checks if llvm-dwp can find the compilation unit if
2# both type and compile units are available in the debug info section (v5)
3
4# RUN: llvm-mc --triple=x86_64-unknown-linux --filetype=obj --split-dwarf-file=%t.dwo -dwarf-version=5 %s -o %t.o
5# RUN: llvm-dwp %t.dwo -o %t.dwp
6# RUN: llvm-dwarfdump -debug-info -debug-tu-index %t.dwp | FileCheck %s
7
8## Note: For this test we do not need to define the DIE for the structure type, as we only want to
9## have the info on the type and compile units.
10
11# CHECK-DAG: .debug_info.dwo contents
12# 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 = {{.*}}, type_offset = 0x0019 (next unit at 0x0000001b)
13# CHECK: 0x0000001b: Compile Unit: length = 0x00000011, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset = 0x0000, addr_size = 0x08, DWO_id = {{.*}} (next unit at 0x00000030)
14    .section	.debug_info.dwo,"e",@progbits
15    .long	.Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
16.Ldebug_info_dwo_start0:
17    .short	5                               # DWARF version number
18    .byte	6                               # DWARF Unit Type (DW_UT_split_type)
19    .byte	8                               # Address Size (in bytes)
20    .long	0                               # Offset Into Abbrev. Section
21    .quad	5657452045627120676             # Type Signature
22    .long	25                              # Type DIE Offset
23    .byte	1                               # Abbrev [1] DW_TAG_type_unit
24    .byte	2                               # Abbrev [2] DW_TAG_structure_type
25    .byte	0                               # End Of Children Mark
26.Ldebug_info_dwo_end0:
27    .section	.debug_info.dwo,"e",@progbits
28    .long	.Ldebug_info_dwo_end1-.Ldebug_info_dwo_start1 # Length of Unit
29.Ldebug_info_dwo_start1:
30    .short	5                               # DWARF version number
31    .byte	5                               # DWARF Unit Type (DW_UT_split_compile)
32    .byte	8                               # Address Size (in bytes)
33    .long	0                               # Offset Into Abbrev. Section
34    .quad	-1506010254921578184
35    .byte	3                               # Abbrev [3] DW_TAG_compile_unit
36.Ldebug_info_dwo_end1:
37    .section	.debug_abbrev.dwo,"e",@progbits
38    .byte	1                               # Abbreviation Code
39    .byte	65                              # DW_TAG_type_unit
40    .byte	1                               # DW_CHILDREN_yes
41    .byte	0                               # EOM(1)
42    .byte	0                               # EOM(2)
43    .byte	3                               # Abbreviation Code
44    .byte	17                              # DW_TAG_compile_unit
45    .byte	0                               # DW_CHILDREN_no
46    .byte	0                               # EOM(1)
47    .byte	0                               # EOM(2)
48    .byte	0                               # EOM(3)
49