xref: /llvm-project/llvm/test/tools/llvm-dwp/X86/loclists.s (revision 7fc79340234f3acd354c52bd8bf2cf44f38fc4be)
1# This test checks if llvm-dwp outputs .debug_loclists.
2
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-loclists -debug-cu-index -debug-tu-index %t.dwp | FileCheck %s
7
8# CHECK-DAG: .debug_loclists.dwo contents:
9# CHECK: locations list header: length = 0x00000019, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
10# CHECK-NEXT: offsets: [
11# CHECK-NEXT: 0x00000004
12# CHECK-NEXT: ]
13# CHECK: DW_LLE_base_addressx   (0x0000000000000000)
14# CHECK-NEXT: DW_LLE_offset_pair     (0x0000000000000000, 0x0000000000000004): DW_OP_reg5 RDI
15# CHECK-NEXT: DW_LLE_offset_pair     (0x0000000000000004, 0x0000000000000008): DW_OP_reg3 RBX
16
17# CHECK-DAG: .debug_cu_index contents:
18# CHECK: Index Signature          INFO                         ABBREV                   LOCLISTS
19# CHECK:     1 {{.*}} [0x0000000000000018, 0x000000000000002d) [0x00000000, 0x00000004) [0x00000000, 0x0000001d)
20
21# CHECK-DAG: .debug_tu_index contents:
22# CHECK: Index Signature          INFO                         ABBREV                   LOCLISTS
23# CHECK:     2 {{.*}} [0x0000000000000000, 0x0000000000000018) [0x00000000, 0x00000004) [0x00000000, 0x0000001d)
24
25	.section	.debug_info.dwo,"e",@progbits
26	.long	.Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
27.Ldebug_info_dwo_start0:
28	.short	5                               # DWARF version number
29	.byte	6                               # DWARF Unit Type
30	.byte	8                               # Address Size (in bytes)
31	.long	0                               # Offset Into Abbrev. Section
32	.quad	-4287463584810542331            # Type Signature
33	.long	31                              # Type DIE Offset
34.Ldebug_info_dwo_end0:
35	.section	.debug_info.dwo,"e",@progbits
36	.long	.Ldebug_info_dwo_end3-.Ldebug_info_dwo_start3 # Length of Unit
37.Ldebug_info_dwo_start3:
38	.short	5                               # DWARF version number
39	.byte	5                               # DWARF Unit Type
40	.byte	8                               # Address Size (in bytes)
41	.long	0                               # Offset Into Abbrev. Section
42	.quad	1152943841751211454
43	.byte	1                              # Abbrev [1] 0x14:0x349 DW_TAG_compile_unit
44.Ldebug_info_dwo_end3:
45	.section	.debug_loclists.dwo,"e",@progbits
46	.long	.Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
47.Ldebug_list_header_start0:
48	.short	5                               # Version
49	.byte	8                               # Address size
50	.byte	0                               # Segment selector size
51	.long	1                               # Offset entry count
52.Lloclists_table_base0:
53	.long	.Ldebug_loc0-.Lloclists_table_base0
54.Ldebug_loc0:
55	.byte	1                               # DW_LLE_base_addressx
56	.byte	0                               #   base address index
57	.byte	4                               # DW_LLE_offset_pair
58	.uleb128 0                            #   starting offset
59	.uleb128 4                            #   ending offset
60	.byte	1                               # Loc expr size
61	.byte	85                              # DW_OP_reg5
62	.byte	4                               # DW_LLE_offset_pair
63	.uleb128 4                            #   starting offset
64	.uleb128 8                            #   ending offset
65	.byte	1                               # Loc expr size
66	.byte	83                              # DW_OP_reg3
67	.byte	0                               # DW_LLE_end_of_list
68.Ldebug_list_header_end0:
69	.section	.debug_abbrev.dwo,"e",@progbits
70	.byte	1                              # Abbreviation Code
71	.byte	17                              # DW_TAG_compile_unit
72	.byte	0                               # DW_CHILDREN_no
73	.byte	0                               # EOM(1)
74