xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/AArch64/ptrauth.s (revision 513d9f2395ea017e72602ca6e747a2e061ab8c3f)
1# RUN: llvm-mc %s -filetype obj -triple arm64-apple-darwin -o %t
2# RUN: llvm-dwarfdump --debug-info %t | FileCheck %s
3# RUN: llvm-dwarfdump --verify %t
4
5# CHECK: 0x0000001e:   DW_TAG_variable
6# CHECK:                 DW_AT_name      ("p1")
7# CHECK:                 DW_AT_type      (0x00000033 "void *__ptrauth(4, 1, 0x04d2)")
8
9# CHECK: 0x00000033:   DW_TAG_LLVM_ptrauth_type
10# CHECK:                 DW_AT_LLVM_ptrauth_key  (0x04)
11# CHECK:                 DW_AT_LLVM_ptrauth_address_discriminated        (true)
12# CHECK:                 DW_AT_LLVM_ptrauth_extra_discriminator  (0x04d2)
13
14# CHECK: 0x0000003c:   DW_TAG_variable
15# CHECK:                 DW_AT_name      ("p2")
16# CHECK:                 DW_AT_type      (0x00000047 "void *__ptrauth(4, 1, 0x04d3, "isa-pointer")")
17
18# CHECK: 0x00000047:   DW_TAG_LLVM_ptrauth_type
19# CHECK:                 DW_AT_LLVM_ptrauth_key  (0x04)
20# CHECK:                 DW_AT_LLVM_ptrauth_address_discriminated        (true)
21# CHECK:                 DW_AT_LLVM_ptrauth_extra_discriminator  (0x04d3)
22# CHECK:                 DW_AT_LLVM_ptrauth_isa_pointer  (true)
23
24# CHECK: 0x0000004f:   DW_TAG_variable
25# CHECK:                 DW_AT_name      ("p3")
26# CHECK:                 DW_AT_type      (0x0000005a "void *__ptrauth(4, 1, 0x04d4, "authenticates-null-values,strip")")
27
28# CHECK: 0x0000005a:   DW_TAG_LLVM_ptrauth_type
29# CHECK:                 DW_AT_LLVM_ptrauth_key  (0x04)
30# CHECK:                 DW_AT_LLVM_ptrauth_address_discriminated        (true)
31# CHECK:                 DW_AT_LLVM_ptrauth_extra_discriminator  (0x04d4)
32# CHECK:                 DW_AT_LLVM_ptrauth_authenticates_null_values    (true)
33
34# CHECK: 0x00000063:   DW_TAG_variable
35# CHECK:                 DW_AT_name      ("p4")
36# CHECK:                 DW_AT_type (0x0000006e "void *__ptrauth(4, 1, 0x04d5, "isa-pointer,authenticates-null-values,sign-and-strip")")
37
38# CHECK: 0x0000006e:   DW_TAG_LLVM_ptrauth_type
39# CHECK:                 DW_AT_LLVM_ptrauth_key  (0x04)
40# CHECK:                 DW_AT_LLVM_ptrauth_address_discriminated        (true)
41# CHECK:                 DW_AT_LLVM_ptrauth_extra_discriminator  (0x04d5)
42# CHECK:                 DW_AT_LLVM_ptrauth_isa_pointer  (true)
43# CHECK:                 DW_AT_LLVM_ptrauth_authenticates_null_values    (true)
44
45	.section	__TEXT,__text,regular,pure_instructions
46	.file	1 "/" "/tmp/p.c"
47	.comm	_p,8,3                          ; @p
48	.section	__DWARF,__debug_abbrev,regular,debug
49Lsection_abbrev:
50	.byte	1                               ; Abbreviation Code
51	.byte	17                              ; DW_TAG_compile_unit
52	.byte	1                               ; DW_CHILDREN_yes
53	.byte	37                              ; DW_AT_producer
54	.byte	14                              ; DW_FORM_strp
55	.byte	19                              ; DW_AT_language
56	.byte	5                               ; DW_FORM_data2
57	.byte	3                               ; DW_AT_name
58	.byte	14                              ; DW_FORM_strp
59	.byte	16                              ; DW_AT_stmt_list
60	.byte	23                              ; DW_FORM_sec_offset
61	.byte	27                              ; DW_AT_comp_dir
62	.byte	14                              ; DW_FORM_strp
63	.byte	0                               ; EOM(1)
64	.byte	0                               ; EOM(2)
65	.byte	2                               ; Abbreviation Code
66	.byte	52                              ; DW_TAG_variable
67	.byte	0                               ; DW_CHILDREN_no
68	.byte	3                               ; DW_AT_name
69	.byte	14                              ; DW_FORM_strp
70	.byte	73                              ; DW_AT_type
71	.byte	19                              ; DW_FORM_ref4
72	.byte	63                              ; DW_AT_external
73	.byte	25                              ; DW_FORM_flag_present
74	.byte	58                              ; DW_AT_decl_file
75	.byte	11                              ; DW_FORM_data1
76	.byte	59                              ; DW_AT_decl_line
77	.byte	11                              ; DW_FORM_data1
78	.byte	2                               ; DW_AT_location
79	.byte	24                              ; DW_FORM_exprloc
80	.byte	0                               ; EOM(1)
81	.byte	0                               ; EOM(2)
82	.byte	3                               ; Abbreviation Code
83	.ascii	"\200\206\001"                  ; DW_TAG_LLVM_ptrauth_type
84	.byte	0                               ; DW_CHILDREN_no
85	.byte	73                              ; DW_AT_type
86	.byte	19                              ; DW_FORM_ref4
87	.ascii	"\204|"                         ; DW_AT_LLVM_ptrauth_key
88	.byte	11                              ; DW_FORM_data1
89	.ascii	"\205|"                         ; DW_AT_LLVM_ptrauth_address_discriminated
90	.byte	25                              ; DW_FORM_flag_present
91	.ascii	"\206|"                         ; DW_AT_LLVM_ptrauth_extra_discriminator
92	.byte	5                               ; DW_FORM_data2
93	.byte	0                               ; EOM(1)
94	.byte	0                               ; EOM(2)
95	.byte	4                               ; Abbreviation Code
96	.byte	15                              ; DW_TAG_pointer_type
97	.byte	0                               ; DW_CHILDREN_no
98	.byte	0                               ; EOM(1)
99	.byte	0                               ; EOM(2)
100	.byte	5                               ; Abbreviation Code
101	.byte	52                              ; DW_TAG_variable
102	.byte	0                               ; DW_CHILDREN_no
103	.byte	3                               ; DW_AT_name
104	.byte	14                              ; DW_FORM_strp
105	.byte	73                              ; DW_AT_type
106	.byte	19                              ; DW_FORM_ref4
107	.byte	63                              ; DW_AT_external
108	.byte	25                              ; DW_FORM_flag_present
109	.byte	58                              ; DW_AT_decl_file
110	.byte	11                              ; DW_FORM_data1
111	.byte	59                              ; DW_AT_decl_line
112	.byte	11                              ; DW_FORM_data1
113	.byte	0                               ; EOM(1)
114	.byte	0                               ; EOM(2)
115	.byte	6                               ; Abbreviation Code
116	.ascii	"\200\206\001"                  ; DW_TAG_LLVM_ptrauth_type
117	.byte	0                               ; DW_CHILDREN_no
118	.byte	73                              ; DW_AT_type
119	.byte	19                              ; DW_FORM_ref4
120	.ascii	"\204|"                         ; DW_AT_LLVM_ptrauth_key
121	.byte	11                              ; DW_FORM_data1
122	.ascii	"\205|"                         ; DW_AT_LLVM_ptrauth_address_discriminated
123	.byte	25                              ; DW_FORM_flag_present
124	.ascii	"\206|"                         ; DW_AT_LLVM_ptrauth_extra_discriminator
125	.byte	5                               ; DW_FORM_data2
126	.ascii	"\210|"                         ; DW_AT_LLVM_ptrauth_isa_pointer
127	.byte	25                              ; DW_FORM_flag_present
128	.byte	0                               ; EOM(1)
129	.byte	0                               ; EOM(2)
130	.byte	7                               ; Abbreviation Code
131	.ascii	"\200\206\001"                  ; DW_TAG_LLVM_ptrauth_type
132	.byte	0                               ; DW_CHILDREN_no
133	.byte	73                              ; DW_AT_type
134	.byte	19                              ; DW_FORM_ref4
135	.ascii	"\204|"                         ; DW_AT_LLVM_ptrauth_key
136	.byte	11                              ; DW_FORM_data1
137	.ascii	"\205|"                         ; DW_AT_LLVM_ptrauth_address_discriminated
138	.byte	25                              ; DW_FORM_flag_present
139	.ascii	"\206|"                         ; DW_AT_LLVM_ptrauth_extra_discriminator
140	.byte	5                               ; DW_FORM_data2
141	.ascii	"\211|"                         ; DW_AT_LLVM_ptrauth_authenticates_null_values
142	.byte	25                              ; DW_FORM_flag_present
143	.ascii	"\212|"                         ; DW_AT_LLVM_ptrauth_authentication_mode
144	.byte	11                              ; DW_FORM_data1
145	.byte	0                               ; EOM(1)
146	.byte	0                               ; EOM(2)
147	.byte	8                               ; Abbreviation Code
148	.ascii	"\200\206\001"                  ; DW_TAG_LLVM_ptrauth_type
149	.byte	0                               ; DW_CHILDREN_no
150	.byte	73                              ; DW_AT_type
151	.byte	19                              ; DW_FORM_ref4
152	.ascii	"\204|"                         ; DW_AT_LLVM_ptrauth_key
153	.byte	11                              ; DW_FORM_data1
154	.ascii	"\205|"                         ; DW_AT_LLVM_ptrauth_address_discriminated
155	.byte	25                              ; DW_FORM_flag_present
156	.ascii	"\206|"                         ; DW_AT_LLVM_ptrauth_extra_discriminator
157	.byte	5                               ; DW_FORM_data2
158	.ascii	"\210|"                         ; DW_AT_LLVM_ptrauth_isa_pointer
159	.byte	25                              ; DW_FORM_flag_present
160	.ascii	"\211|"                         ; DW_AT_LLVM_ptrauth_authenticates_null_values
161	.byte	25                              ; DW_FORM_flag_present
162	.ascii	"\212|"                         ; DW_AT_LLVM_ptrauth_authentication_mode
163	.byte	11                              ; DW_FORM_data1
164	.byte	0                               ; EOM(1)
165	.byte	0                               ; EOM(2)
166	.byte	0                               ; EOM(3)
167	.section	__DWARF,__debug_info,regular,debug
168Lsection_info:
169Lcu_begin0:
170.set Lset0, Ldebug_info_end0-Ldebug_info_start0 ; Length of Unit
171	.long	Lset0
172Ldebug_info_start0:
173	.short	4                               ; DWARF version number
174.set Lset1, Lsection_abbrev-Lsection_abbrev ; Offset Into Abbrev. Section
175	.long	Lset1
176	.byte	8                               ; Address Size (in bytes)
177	.byte	1                               ; Abbrev [1] 0xb:0x6d DW_TAG_compile_unit
178	.long	0                               ; DW_AT_producer
179	.short	12                              ; DW_AT_language
180	.long	1                               ; DW_AT_name
181.set Lset2, Lline_table_start0-Lsection_line ; DW_AT_stmt_list
182	.long	Lset2
183	.long	10                              ; DW_AT_comp_dir
184	.byte	2                               ; Abbrev [2] 0x1e:0x15 DW_TAG_variable
185	.long	12                              ; DW_AT_name
186	.long	51                              ; DW_AT_type
187                                        ; DW_AT_external
188	.byte	1                               ; DW_AT_decl_file
189	.byte	1                               ; DW_AT_decl_line
190	.byte	9                               ; DW_AT_location
191	.byte	3
192	.quad	_p
193	.byte	3                               ; Abbrev [3] 0x33:0x8 DW_TAG_LLVM_ptrauth_type
194	.long	59                              ; DW_AT_type
195	.byte	4                               ; DW_AT_LLVM_ptrauth_key
196                                        ; DW_AT_LLVM_ptrauth_address_discriminated
197	.short	1234                            ; DW_AT_LLVM_ptrauth_extra_discriminator
198	.byte	4                               ; Abbrev [4] 0x3b:0x1 DW_TAG_pointer_type
199	.byte	5                               ; Abbrev [5] 0x3c:0xb DW_TAG_variable
200	.long	15                              ; DW_AT_name
201	.long	71                              ; DW_AT_type
202                                        ; DW_AT_external
203	.byte	1                               ; DW_AT_decl_file
204	.byte	1                               ; DW_AT_decl_line
205	.byte	6                               ; Abbrev [6] 0x47:0x8 DW_TAG_LLVM_ptrauth_type
206	.long	59                              ; DW_AT_type
207	.byte	4                               ; DW_AT_LLVM_ptrauth_key
208                                        ; DW_AT_LLVM_ptrauth_address_discriminated
209	.short	1235                            ; DW_AT_LLVM_ptrauth_extra_discriminator
210                                        ; DW_AT_LLVM_ptrauth_isa_pointer
211	.byte	5                               ; Abbrev [5] 0x4f:0xb DW_TAG_variable
212	.long	18                              ; DW_AT_name
213	.long	90                              ; DW_AT_type
214                                        ; DW_AT_external
215	.byte	1                               ; DW_AT_decl_file
216	.byte	1                               ; DW_AT_decl_line
217	.byte	7                               ; Abbrev [7] 0x5a:0x9 DW_TAG_LLVM_ptrauth_type
218	.long	59                              ; DW_AT_type
219	.byte	4                               ; DW_AT_LLVM_ptrauth_key
220                                        ; DW_AT_LLVM_ptrauth_address_discriminated
221	.short	1236                            ; DW_AT_LLVM_ptrauth_extra_discriminator
222                                        ; DW_AT_LLVM_ptrauth_authenticates_null_values
223	.byte	1                               ; DW_AT_LLVM_ptrauth_authentication_mode
224	.byte	5                               ; Abbrev [5] 0x63:0xb DW_TAG_variable
225	.long	21                              ; DW_AT_name
226	.long	110                             ; DW_AT_type
227                                        ; DW_AT_external
228	.byte	1                               ; DW_AT_decl_file
229	.byte	1                               ; DW_AT_decl_line
230	.byte	8                               ; Abbrev [8] 0x6e:0x9 DW_TAG_LLVM_ptrauth_type
231	.long	59                              ; DW_AT_type
232	.byte	4                               ; DW_AT_LLVM_ptrauth_key
233                                        ; DW_AT_LLVM_ptrauth_address_discriminated
234	.short	1237                            ; DW_AT_LLVM_ptrauth_extra_discriminator
235                                        ; DW_AT_LLVM_ptrauth_isa_pointer
236                                        ; DW_AT_LLVM_ptrauth_authenticates_null_values
237	.byte	2                               ; DW_AT_LLVM_ptrauth_authentication_mode
238	.byte	0                               ; End Of Children Mark
239Ldebug_info_end0:
240	.section	__DWARF,__debug_str,regular,debug
241Linfo_string:
242	.byte	0                               ; string offset=0
243	.asciz	"/tmp/p.c"                      ; string offset=1
244	.asciz	"/"                             ; string offset=10
245	.asciz	"p1"                            ; string offset=12
246	.asciz	"p2"                            ; string offset=15
247	.asciz	"p3"                            ; string offset=18
248	.asciz	"p4"                            ; string offset=21
249	.section	__DWARF,__apple_names,regular,debug
250Lnames_begin:
251	.long	1212240712                      ; Header Magic
252	.short	1                               ; Header Version
253	.short	0                               ; Header Hash Function
254	.long	1                               ; Header Bucket Count
255	.long	1                               ; Header Hash Count
256	.long	12                              ; Header Data Length
257	.long	0                               ; HeaderData Die Offset Base
258	.long	1                               ; HeaderData Atom Count
259	.short	1                               ; DW_ATOM_die_offset
260	.short	6                               ; DW_FORM_data4
261	.long	0                               ; Bucket 0
262	.long	5863654                         ; Hash in Bucket 0
263.set Lset3, LNames0-Lnames_begin        ; Offset in Bucket 0
264	.long	Lset3
265LNames0:
266	.long	12                              ; p1
267	.long	1                               ; Num DIEs
268	.long	30
269	.long	0
270	.section	__DWARF,__apple_objc,regular,debug
271Lobjc_begin:
272	.long	1212240712                      ; Header Magic
273	.short	1                               ; Header Version
274	.short	0                               ; Header Hash Function
275	.long	1                               ; Header Bucket Count
276	.long	0                               ; Header Hash Count
277	.long	12                              ; Header Data Length
278	.long	0                               ; HeaderData Die Offset Base
279	.long	1                               ; HeaderData Atom Count
280	.short	1                               ; DW_ATOM_die_offset
281	.short	6                               ; DW_FORM_data4
282	.long	-1                              ; Bucket 0
283	.section	__DWARF,__apple_namespac,regular,debug
284Lnamespac_begin:
285	.long	1212240712                      ; Header Magic
286	.short	1                               ; Header Version
287	.short	0                               ; Header Hash Function
288	.long	1                               ; Header Bucket Count
289	.long	0                               ; Header Hash Count
290	.long	12                              ; Header Data Length
291	.long	0                               ; HeaderData Die Offset Base
292	.long	1                               ; HeaderData Atom Count
293	.short	1                               ; DW_ATOM_die_offset
294	.short	6                               ; DW_FORM_data4
295	.long	-1                              ; Bucket 0
296	.section	__DWARF,__apple_types,regular,debug
297Ltypes_begin:
298	.long	1212240712                      ; Header Magic
299	.short	1                               ; Header Version
300	.short	0                               ; Header Hash Function
301	.long	1                               ; Header Bucket Count
302	.long	0                               ; Header Hash Count
303	.long	20                              ; Header Data Length
304	.long	0                               ; HeaderData Die Offset Base
305	.long	3                               ; HeaderData Atom Count
306	.short	1                               ; DW_ATOM_die_offset
307	.short	6                               ; DW_FORM_data4
308	.short	3                               ; DW_ATOM_die_tag
309	.short	5                               ; DW_FORM_data2
310	.short	4                               ; DW_ATOM_type_flags
311	.short	11                              ; DW_FORM_data1
312	.long	-1                              ; Bucket 0
313.subsections_via_symbols
314	.section	__DWARF,__debug_line,regular,debug
315Lsection_line:
316Lline_table_start0:
317