1# Test handling of DWARF5 DW_FORM_line_strp from .debug_info as used by GCC.
2
3# UNSUPPORTED: system-darwin, system-windows
4
5# RUN: llvm-mc -filetype=obj -o %t -triple x86_64-pc-linux %s
6# RUN: %lldb %t -o "p main" \
7# RUN:   -o exit | FileCheck %s
8
9# CHECK: (void (*)()) $0 = 0x0000000000000000
10
11	.text
12.Ltext0:
13	.globl	main
14	.type	main, @function
15main:
16.LFB0:
17.LM1:
18        .long	0
19.LM2:
20        .long	0
21.LFE0:
22	.size	main, .-main
23.Letext0:
24	.section	.debug_info,"",@progbits
25.Ldebug_info0:
26	.long	.Ldebug_info0_end - .Ldebug_info0_start	# Length of Compilation Unit Info
27.Ldebug_info0_start:
28	.value	0x5	# DWARF version number
29	.byte	0x1	# DW_UT_compile
30	.byte	0x8	# Pointer Size (in bytes)
31	.long	.Ldebug_abbrev0	# Offset Into Abbrev. Section
32	.uleb128 0x1	# (DIE DW_TAG_compile_unit)
33	.long	.LASF2	# DW_AT_producer: "GNU C17 11.0.0 20210210 (Red Hat 11.0.0-0) -mtune=generic -march=x86-64 -gdwarf-5 -gno-as-loc-support"
34	.byte	0x1d	# DW_AT_language
35	.long	.LASF0	# DW_AT_name: "main.c"
36	.long	.LASF1	# DW_AT_comp_dir: ""
37	.quad	.Ltext0	# DW_AT_low_pc
38	.quad	.Letext0-.Ltext0	# DW_AT_high_pc
39	.long	.Ldebug_line0	# DW_AT_stmt_list
40	.uleb128 0x2	# (DIE DW_TAG_subprogram)
41			# DW_AT_external
42	.long	.LASF3	# DW_AT_name: "main"
43	.byte	0x1	# DW_AT_decl_file (main.c)
44	.byte	0x1	# DW_AT_decl_line
45	.quad	.LFB0	# DW_AT_low_pc
46	.quad	.LFE0-.LFB0	# DW_AT_high_pc
47	.byte	0	# end of children of DIE DW_TAG_compile_unit
48.Ldebug_info0_end:
49	.section	.debug_abbrev,"",@progbits
50.Ldebug_abbrev0:
51	.uleb128 0x1	# (abbrev code)
52	.uleb128 0x11	# (TAG: DW_TAG_compile_unit)
53	.byte	0x1	# DW_children_yes
54	.uleb128 0x25	# (DW_AT_producer)
55	.uleb128 0xe	# (DW_FORM_strp)
56	.uleb128 0x13	# (DW_AT_language)
57	.uleb128 0xb	# (DW_FORM_data1)
58	.uleb128 0x3	# (DW_AT_name)
59	.uleb128 0x1f	# (DW_FORM_line_strp)
60	.uleb128 0x1b	# (DW_AT_comp_dir)
61	.uleb128 0x1f	# (DW_FORM_line_strp)
62	.uleb128 0x11	# (DW_AT_low_pc)
63	.uleb128 0x1	# (DW_FORM_addr)
64	.uleb128 0x12	# (DW_AT_high_pc)
65	.uleb128 0x7	# (DW_FORM_data8)
66	.uleb128 0x10	# (DW_AT_stmt_list)
67	.uleb128 0x17	# (DW_FORM_sec_offset)
68	.byte	0
69	.byte	0
70	.uleb128 0x2	# (abbrev code)
71	.uleb128 0x2e	# (TAG: DW_TAG_subprogram)
72	.byte	0	# DW_children_no
73	.uleb128 0x3f	# (DW_AT_external)
74	.uleb128 0x19	# (DW_FORM_flag_present)
75	.uleb128 0x3	# (DW_AT_name)
76	.uleb128 0xe	# (DW_FORM_strp)
77	.uleb128 0x3a	# (DW_AT_decl_file)
78	.uleb128 0xb	# (DW_FORM_data1)
79	.uleb128 0x3b	# (DW_AT_decl_line)
80	.uleb128 0xb	# (DW_FORM_data1)
81	.uleb128 0x11	# (DW_AT_low_pc)
82	.uleb128 0x1	# (DW_FORM_addr)
83	.uleb128 0x12	# (DW_AT_high_pc)
84	.uleb128 0x7	# (DW_FORM_data8)
85	.byte	0
86	.byte	0
87	.byte	0
88	.section	.debug_line,"",@progbits
89.Ldebug_line0:
90	.long	.LELT0-.LSLT0	# Length of Source Line Info
91.LSLT0:
92	.value	0x5	# DWARF version number
93	.byte	0x8	# Address Size
94	.byte	0	# Segment Size
95	.long	.LELTP0-.LASLTP0	# Prolog Length
96.LASLTP0:
97	.byte	0x1	# Minimum Instruction Length
98	.byte	0x1	# Maximum Operations Per Instruction
99	.byte	0x1	# Default is_stmt_start flag
100	.byte	0xf6	# Line Base Value (Special Opcodes)
101	.byte	0xf2	# Line Range Value (Special Opcodes)
102	.byte	0xd	# Special Opcode Base
103	.byte	0	# opcode: 0x1 has 0 args
104	.byte	0x1	# opcode: 0x2 has 1 args
105	.byte	0x1	# opcode: 0x3 has 1 args
106	.byte	0x1	# opcode: 0x4 has 1 args
107	.byte	0x1	# opcode: 0x5 has 1 args
108	.byte	0	# opcode: 0x6 has 0 args
109	.byte	0	# opcode: 0x7 has 0 args
110	.byte	0	# opcode: 0x8 has 0 args
111	.byte	0x1	# opcode: 0x9 has 1 args
112	.byte	0	# opcode: 0xa has 0 args
113	.byte	0	# opcode: 0xb has 0 args
114	.byte	0x1	# opcode: 0xc has 1 args
115	.byte	0x1	# Directory entry format count
116	.uleb128 0x1	# DW_LNCT_path
117	.uleb128 0x1f	# DW_FORM_line_strp
118	.uleb128 0x2	# Directories count
119	.long	.LASF1	# Directory Entry: 0: ""
120	.long	.LASF4	# Directory Entry: 0: ""
121	.byte	0x2	# File name entry format count
122	.uleb128 0x1	# DW_LNCT_path
123	.uleb128 0x1f	# DW_FORM_line_strp
124	.uleb128 0x2	# DW_LNCT_directory_index
125	.uleb128 0xb	# DW_FORM_data1
126	.uleb128 0x2	# File names count
127	.long	.LASF0	# File Entry: 0: "main.c"
128	.byte	0
129	.long	.LASF5	# File Entry: 0: "main.c"
130	.byte	0x1
131.LELTP0:
132	.byte	0	# set address *.LM1
133	.uleb128 0x9
134	.byte	0x2
135	.quad	.LM1
136	.byte	0x1	# copy line 1
137	.byte	0x5	# column 12
138	.uleb128 0xc	# 12
139	.byte	0	# set address *.LM2
140	.uleb128 0x9
141	.byte	0x2
142	.quad	.LM2
143	.byte	0x1	# copy line 1
144	.byte	0x5	# column 13
145	.uleb128 0xd	# 13
146	.byte	0	# set address *.Letext0
147	.uleb128 0x9
148	.byte	0x2
149	.quad	.Letext0
150	.byte	0	# end sequence
151	.uleb128 0x1
152	.byte	0x1
153.LELT0:
154	.section	.debug_str,"MS",@progbits,1
155.LASF2:
156	.string	"GNU C17 11.0.0 20210210 (Red Hat 11.0.0-0) -mtune=generic -march=x86-64 -gdwarf-5 -gno-as-loc-support"
157.LASF3:
158	.string	"main"
159	.section	.debug_line_str,"MS",@progbits,1
160.LASF1:
161	.string	""
162.LASF4:
163	.string	""
164.LASF0:
165	.string	"main.c"
166.LASF5:
167	.string	"main.c"
168	.ident	"GCC: (GNU) 11.0.0 20210210 (Red Hat 11.0.0-0)"
169	.section	.note.GNU-stack,"",@progbits
170