1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple arm64e-apple-darwin -global-isel=0 -verify-machineinstrs \
3 ; RUN: -aarch64-ptrauth-auth-checks=none | FileCheck %s -DL="L" --check-prefix=UNCHECKED
4 ; RUN: llc < %s -mtriple arm64e-apple-darwin -global-isel -global-isel-abort=1 -verify-machineinstrs \
5 ; RUN: -aarch64-ptrauth-auth-checks=none | FileCheck %s -DL="L" --check-prefix=UNCHECKED
7 ; RUN: llc < %s -mtriple arm64e-apple-darwin -global-isel=0 -verify-machineinstrs \
8 ; RUN: | FileCheck %s -DL="L" --check-prefix=CHECKED
9 ; RUN: llc < %s -mtriple arm64e-apple-darwin -global-isel -global-isel-abort=1 -verify-machineinstrs \
10 ; RUN: | FileCheck %s -DL="L" --check-prefix=CHECKED
12 ; RUN: llc < %s -mtriple arm64e-apple-darwin -global-isel=0 -verify-machineinstrs \
13 ; RUN: -aarch64-ptrauth-auth-checks=trap | FileCheck %s -DL="L" --check-prefix=TRAP
14 ; RUN: llc < %s -mtriple arm64e-apple-darwin -global-isel -global-isel-abort=1 -verify-machineinstrs \
15 ; RUN: -aarch64-ptrauth-auth-checks=trap | FileCheck %s -DL="L" --check-prefix=TRAP
17 ; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -global-isel=0 -verify-machineinstrs \
18 ; RUN: -aarch64-ptrauth-auth-checks=none | FileCheck %s -DL=".L" --check-prefix=UNCHECKED
19 ; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -global-isel -global-isel-abort=1 -verify-machineinstrs \
20 ; RUN: -aarch64-ptrauth-auth-checks=none | FileCheck %s -DL=".L" --check-prefix=UNCHECKED
22 ; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -global-isel=0 -verify-machineinstrs \
23 ; RUN: | FileCheck %s -DL=".L" --check-prefix=CHECKED
24 ; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -global-isel -global-isel-abort=1 -verify-machineinstrs \
25 ; RUN: | FileCheck %s -DL=".L" --check-prefix=CHECKED
27 ; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -global-isel=0 -verify-machineinstrs \
28 ; RUN: -aarch64-ptrauth-auth-checks=trap | FileCheck %s -DL=".L" --check-prefix=TRAP
29 ; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -global-isel -global-isel-abort=1 -verify-machineinstrs \
30 ; RUN: -aarch64-ptrauth-auth-checks=trap | FileCheck %s -DL=".L" --check-prefix=TRAP
32 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
34 define i64 @test_auth_ia(i64 %arg, i64 %arg1) {
35 ; UNCHECKED-LABEL: test_auth_ia:
37 ; UNCHECKED-NEXT: mov x16, x0
38 ; UNCHECKED-NEXT: autia x16, x1
39 ; UNCHECKED-NEXT: mov x0, x16
42 ; CHECKED-LABEL: test_auth_ia:
44 ; CHECKED-NEXT: mov x16, x0
45 ; CHECKED-NEXT: autia x16, x1
46 ; CHECKED-NEXT: mov x0, x16
49 ; TRAP-LABEL: test_auth_ia:
51 ; TRAP-NEXT: mov x16, x0
52 ; TRAP-NEXT: autia x16, x1
53 ; TRAP-NEXT: mov x17, x16
54 ; TRAP-NEXT: xpaci x17
55 ; TRAP-NEXT: cmp x16, x17
56 ; TRAP-NEXT: b.eq [[L]]auth_success_0
57 ; TRAP-NEXT: brk #0xc470
58 ; TRAP-NEXT: Lauth_success_0:
59 ; TRAP-NEXT: mov x0, x16
61 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 0, i64 %arg1)
65 define i64 @test_auth_ia_zero(i64 %arg) {
66 ; UNCHECKED-LABEL: test_auth_ia_zero:
68 ; UNCHECKED-NEXT: mov x16, x0
69 ; UNCHECKED-NEXT: autiza x16
70 ; UNCHECKED-NEXT: mov x0, x16
73 ; CHECKED-LABEL: test_auth_ia_zero:
75 ; CHECKED-NEXT: mov x16, x0
76 ; CHECKED-NEXT: autiza x16
77 ; CHECKED-NEXT: mov x0, x16
80 ; TRAP-LABEL: test_auth_ia_zero:
82 ; TRAP-NEXT: mov x16, x0
83 ; TRAP-NEXT: autiza x16
84 ; TRAP-NEXT: mov x17, x16
85 ; TRAP-NEXT: xpaci x17
86 ; TRAP-NEXT: cmp x16, x17
87 ; TRAP-NEXT: b.eq [[L]]auth_success_1
88 ; TRAP-NEXT: brk #0xc470
89 ; TRAP-NEXT: Lauth_success_1:
90 ; TRAP-NEXT: mov x0, x16
92 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 0, i64 0)
96 define i64 @test_auth_ib(i64 %arg, i64 %arg1) {
97 ; UNCHECKED-LABEL: test_auth_ib:
99 ; UNCHECKED-NEXT: mov x16, x0
100 ; UNCHECKED-NEXT: autib x16, x1
101 ; UNCHECKED-NEXT: mov x0, x16
102 ; UNCHECKED-NEXT: ret
104 ; CHECKED-LABEL: test_auth_ib:
106 ; CHECKED-NEXT: mov x16, x0
107 ; CHECKED-NEXT: autib x16, x1
108 ; CHECKED-NEXT: mov x0, x16
111 ; TRAP-LABEL: test_auth_ib:
113 ; TRAP-NEXT: mov x16, x0
114 ; TRAP-NEXT: autib x16, x1
115 ; TRAP-NEXT: mov x17, x16
116 ; TRAP-NEXT: xpaci x17
117 ; TRAP-NEXT: cmp x16, x17
118 ; TRAP-NEXT: b.eq [[L]]auth_success_2
119 ; TRAP-NEXT: brk #0xc471
120 ; TRAP-NEXT: Lauth_success_2:
121 ; TRAP-NEXT: mov x0, x16
123 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 1, i64 %arg1)
127 define i64 @test_auth_ib_zero(i64 %arg) {
128 ; UNCHECKED-LABEL: test_auth_ib_zero:
130 ; UNCHECKED-NEXT: mov x16, x0
131 ; UNCHECKED-NEXT: autizb x16
132 ; UNCHECKED-NEXT: mov x0, x16
133 ; UNCHECKED-NEXT: ret
135 ; CHECKED-LABEL: test_auth_ib_zero:
137 ; CHECKED-NEXT: mov x16, x0
138 ; CHECKED-NEXT: autizb x16
139 ; CHECKED-NEXT: mov x0, x16
142 ; TRAP-LABEL: test_auth_ib_zero:
144 ; TRAP-NEXT: mov x16, x0
145 ; TRAP-NEXT: autizb x16
146 ; TRAP-NEXT: mov x17, x16
147 ; TRAP-NEXT: xpaci x17
148 ; TRAP-NEXT: cmp x16, x17
149 ; TRAP-NEXT: b.eq [[L]]auth_success_3
150 ; TRAP-NEXT: brk #0xc471
151 ; TRAP-NEXT: Lauth_success_3:
152 ; TRAP-NEXT: mov x0, x16
154 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 1, i64 0)
158 define i64 @test_auth_da(i64 %arg, i64 %arg1) {
159 ; UNCHECKED-LABEL: test_auth_da:
161 ; UNCHECKED-NEXT: mov x16, x0
162 ; UNCHECKED-NEXT: autda x16, x1
163 ; UNCHECKED-NEXT: mov x0, x16
164 ; UNCHECKED-NEXT: ret
166 ; CHECKED-LABEL: test_auth_da:
168 ; CHECKED-NEXT: mov x16, x0
169 ; CHECKED-NEXT: autda x16, x1
170 ; CHECKED-NEXT: mov x0, x16
173 ; TRAP-LABEL: test_auth_da:
175 ; TRAP-NEXT: mov x16, x0
176 ; TRAP-NEXT: autda x16, x1
177 ; TRAP-NEXT: mov x17, x16
178 ; TRAP-NEXT: xpacd x17
179 ; TRAP-NEXT: cmp x16, x17
180 ; TRAP-NEXT: b.eq [[L]]auth_success_4
181 ; TRAP-NEXT: brk #0xc472
182 ; TRAP-NEXT: Lauth_success_4:
183 ; TRAP-NEXT: mov x0, x16
185 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 2, i64 %arg1)
189 define i64 @test_auth_da_zero(i64 %arg) {
190 ; UNCHECKED-LABEL: test_auth_da_zero:
192 ; UNCHECKED-NEXT: mov x16, x0
193 ; UNCHECKED-NEXT: autdza x16
194 ; UNCHECKED-NEXT: mov x0, x16
195 ; UNCHECKED-NEXT: ret
197 ; CHECKED-LABEL: test_auth_da_zero:
199 ; CHECKED-NEXT: mov x16, x0
200 ; CHECKED-NEXT: autdza x16
201 ; CHECKED-NEXT: mov x0, x16
204 ; TRAP-LABEL: test_auth_da_zero:
206 ; TRAP-NEXT: mov x16, x0
207 ; TRAP-NEXT: autdza x16
208 ; TRAP-NEXT: mov x17, x16
209 ; TRAP-NEXT: xpacd x17
210 ; TRAP-NEXT: cmp x16, x17
211 ; TRAP-NEXT: b.eq [[L]]auth_success_5
212 ; TRAP-NEXT: brk #0xc472
213 ; TRAP-NEXT: Lauth_success_5:
214 ; TRAP-NEXT: mov x0, x16
216 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 2, i64 0)
220 define i64 @test_auth_db(i64 %arg, i64 %arg1) {
221 ; UNCHECKED-LABEL: test_auth_db:
223 ; UNCHECKED-NEXT: mov x16, x0
224 ; UNCHECKED-NEXT: autdb x16, x1
225 ; UNCHECKED-NEXT: mov x0, x16
226 ; UNCHECKED-NEXT: ret
228 ; CHECKED-LABEL: test_auth_db:
230 ; CHECKED-NEXT: mov x16, x0
231 ; CHECKED-NEXT: autdb x16, x1
232 ; CHECKED-NEXT: mov x0, x16
235 ; TRAP-LABEL: test_auth_db:
237 ; TRAP-NEXT: mov x16, x0
238 ; TRAP-NEXT: autdb x16, x1
239 ; TRAP-NEXT: mov x17, x16
240 ; TRAP-NEXT: xpacd x17
241 ; TRAP-NEXT: cmp x16, x17
242 ; TRAP-NEXT: b.eq [[L]]auth_success_6
243 ; TRAP-NEXT: brk #0xc473
244 ; TRAP-NEXT: Lauth_success_6:
245 ; TRAP-NEXT: mov x0, x16
247 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 3, i64 %arg1)
251 define i64 @test_auth_db_zero(i64 %arg) {
252 ; UNCHECKED-LABEL: test_auth_db_zero:
254 ; UNCHECKED-NEXT: mov x16, x0
255 ; UNCHECKED-NEXT: autdzb x16
256 ; UNCHECKED-NEXT: mov x0, x16
257 ; UNCHECKED-NEXT: ret
259 ; CHECKED-LABEL: test_auth_db_zero:
261 ; CHECKED-NEXT: mov x16, x0
262 ; CHECKED-NEXT: autdzb x16
263 ; CHECKED-NEXT: mov x0, x16
266 ; TRAP-LABEL: test_auth_db_zero:
268 ; TRAP-NEXT: mov x16, x0
269 ; TRAP-NEXT: autdzb x16
270 ; TRAP-NEXT: mov x17, x16
271 ; TRAP-NEXT: xpacd x17
272 ; TRAP-NEXT: cmp x16, x17
273 ; TRAP-NEXT: b.eq [[L]]auth_success_7
274 ; TRAP-NEXT: brk #0xc473
275 ; TRAP-NEXT: Lauth_success_7:
276 ; TRAP-NEXT: mov x0, x16
278 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 3, i64 0)
282 ;; Note that this might seem like a no-op but is actually a valid way to enforce
283 ;; the validity of a signature.
284 define i64 @test_resign_ia_ia(i64 %arg, i64 %arg1, i64 %arg2) {
285 ; UNCHECKED-LABEL: test_resign_ia_ia:
287 ; UNCHECKED-NEXT: mov x16, x0
288 ; UNCHECKED-NEXT: autia x16, x1
289 ; UNCHECKED-NEXT: pacia x16, x2
290 ; UNCHECKED-NEXT: mov x0, x16
291 ; UNCHECKED-NEXT: ret
293 ; CHECKED-LABEL: test_resign_ia_ia:
295 ; CHECKED-NEXT: mov x16, x0
296 ; CHECKED-NEXT: autia x16, x1
297 ; CHECKED-NEXT: mov x17, x16
298 ; CHECKED-NEXT: xpaci x17
299 ; CHECKED-NEXT: cmp x16, x17
300 ; CHECKED-NEXT: b.eq [[L]]auth_success_0
301 ; CHECKED-NEXT: mov x16, x17
302 ; CHECKED-NEXT: b [[L]]resign_end_0
303 ; CHECKED-NEXT: Lauth_success_0:
304 ; CHECKED-NEXT: pacia x16, x2
305 ; CHECKED-NEXT: Lresign_end_0:
306 ; CHECKED-NEXT: mov x0, x16
309 ; TRAP-LABEL: test_resign_ia_ia:
311 ; TRAP-NEXT: mov x16, x0
312 ; TRAP-NEXT: autia x16, x1
313 ; TRAP-NEXT: mov x17, x16
314 ; TRAP-NEXT: xpaci x17
315 ; TRAP-NEXT: cmp x16, x17
316 ; TRAP-NEXT: b.eq [[L]]auth_success_8
317 ; TRAP-NEXT: brk #0xc470
318 ; TRAP-NEXT: Lauth_success_8:
319 ; TRAP-NEXT: pacia x16, x2
320 ; TRAP-NEXT: mov x0, x16
322 %tmp = call i64 @llvm.ptrauth.resign(i64 %arg, i32 0, i64 %arg1, i32 0, i64 %arg2)
326 define i64 @test_resign_ib_ia(i64 %arg, i64 %arg1, i64 %arg2) {
327 ; UNCHECKED-LABEL: test_resign_ib_ia:
329 ; UNCHECKED-NEXT: mov x16, x0
330 ; UNCHECKED-NEXT: autib x16, x1
331 ; UNCHECKED-NEXT: pacia x16, x2
332 ; UNCHECKED-NEXT: mov x0, x16
333 ; UNCHECKED-NEXT: ret
335 ; CHECKED-LABEL: test_resign_ib_ia:
337 ; CHECKED-NEXT: mov x16, x0
338 ; CHECKED-NEXT: autib x16, x1
339 ; CHECKED-NEXT: mov x17, x16
340 ; CHECKED-NEXT: xpaci x17
341 ; CHECKED-NEXT: cmp x16, x17
342 ; CHECKED-NEXT: b.eq [[L]]auth_success_1
343 ; CHECKED-NEXT: mov x16, x17
344 ; CHECKED-NEXT: b [[L]]resign_end_1
345 ; CHECKED-NEXT: Lauth_success_1:
346 ; CHECKED-NEXT: pacia x16, x2
347 ; CHECKED-NEXT: Lresign_end_1:
348 ; CHECKED-NEXT: mov x0, x16
351 ; TRAP-LABEL: test_resign_ib_ia:
353 ; TRAP-NEXT: mov x16, x0
354 ; TRAP-NEXT: autib x16, x1
355 ; TRAP-NEXT: mov x17, x16
356 ; TRAP-NEXT: xpaci x17
357 ; TRAP-NEXT: cmp x16, x17
358 ; TRAP-NEXT: b.eq [[L]]auth_success_9
359 ; TRAP-NEXT: brk #0xc471
360 ; TRAP-NEXT: Lauth_success_9:
361 ; TRAP-NEXT: pacia x16, x2
362 ; TRAP-NEXT: mov x0, x16
364 %tmp = call i64 @llvm.ptrauth.resign(i64 %arg, i32 1, i64 %arg1, i32 0, i64 %arg2)
368 define i64 @test_resign_da_ia(i64 %arg, i64 %arg1, i64 %arg2) {
369 ; UNCHECKED-LABEL: test_resign_da_ia:
371 ; UNCHECKED-NEXT: mov x16, x0
372 ; UNCHECKED-NEXT: autda x16, x1
373 ; UNCHECKED-NEXT: pacia x16, x2
374 ; UNCHECKED-NEXT: mov x0, x16
375 ; UNCHECKED-NEXT: ret
377 ; CHECKED-LABEL: test_resign_da_ia:
379 ; CHECKED-NEXT: mov x16, x0
380 ; CHECKED-NEXT: autda x16, x1
381 ; CHECKED-NEXT: mov x17, x16
382 ; CHECKED-NEXT: xpacd x17
383 ; CHECKED-NEXT: cmp x16, x17
384 ; CHECKED-NEXT: b.eq [[L]]auth_success_2
385 ; CHECKED-NEXT: mov x16, x17
386 ; CHECKED-NEXT: b [[L]]resign_end_2
387 ; CHECKED-NEXT: Lauth_success_2:
388 ; CHECKED-NEXT: pacia x16, x2
389 ; CHECKED-NEXT: Lresign_end_2:
390 ; CHECKED-NEXT: mov x0, x16
393 ; TRAP-LABEL: test_resign_da_ia:
395 ; TRAP-NEXT: mov x16, x0
396 ; TRAP-NEXT: autda x16, x1
397 ; TRAP-NEXT: mov x17, x16
398 ; TRAP-NEXT: xpacd x17
399 ; TRAP-NEXT: cmp x16, x17
400 ; TRAP-NEXT: b.eq [[L]]auth_success_10
401 ; TRAP-NEXT: brk #0xc472
402 ; TRAP-NEXT: Lauth_success_10:
403 ; TRAP-NEXT: pacia x16, x2
404 ; TRAP-NEXT: mov x0, x16
406 %tmp = call i64 @llvm.ptrauth.resign(i64 %arg, i32 2, i64 %arg1, i32 0, i64 %arg2)
410 define i64 @test_resign_db_da(i64 %arg, i64 %arg1, i64 %arg2) {
411 ; UNCHECKED-LABEL: test_resign_db_da:
413 ; UNCHECKED-NEXT: mov x16, x0
414 ; UNCHECKED-NEXT: autdb x16, x1
415 ; UNCHECKED-NEXT: pacda x16, x2
416 ; UNCHECKED-NEXT: mov x0, x16
417 ; UNCHECKED-NEXT: ret
419 ; CHECKED-LABEL: test_resign_db_da:
421 ; CHECKED-NEXT: mov x16, x0
422 ; CHECKED-NEXT: autdb x16, x1
423 ; CHECKED-NEXT: mov x17, x16
424 ; CHECKED-NEXT: xpacd x17
425 ; CHECKED-NEXT: cmp x16, x17
426 ; CHECKED-NEXT: b.eq [[L]]auth_success_3
427 ; CHECKED-NEXT: mov x16, x17
428 ; CHECKED-NEXT: b [[L]]resign_end_3
429 ; CHECKED-NEXT: Lauth_success_3:
430 ; CHECKED-NEXT: pacda x16, x2
431 ; CHECKED-NEXT: Lresign_end_3:
432 ; CHECKED-NEXT: mov x0, x16
435 ; TRAP-LABEL: test_resign_db_da:
437 ; TRAP-NEXT: mov x16, x0
438 ; TRAP-NEXT: autdb x16, x1
439 ; TRAP-NEXT: mov x17, x16
440 ; TRAP-NEXT: xpacd x17
441 ; TRAP-NEXT: cmp x16, x17
442 ; TRAP-NEXT: b.eq [[L]]auth_success_11
443 ; TRAP-NEXT: brk #0xc473
444 ; TRAP-NEXT: Lauth_success_11:
445 ; TRAP-NEXT: pacda x16, x2
446 ; TRAP-NEXT: mov x0, x16
448 %tmp = call i64 @llvm.ptrauth.resign(i64 %arg, i32 3, i64 %arg1, i32 2, i64 %arg2)
452 define i64 @test_resign_iza_db(i64 %arg, i64 %arg1, i64 %arg2) {
453 ; UNCHECKED-LABEL: test_resign_iza_db:
455 ; UNCHECKED-NEXT: mov x16, x0
456 ; UNCHECKED-NEXT: autiza x16
457 ; UNCHECKED-NEXT: pacdb x16, x2
458 ; UNCHECKED-NEXT: mov x0, x16
459 ; UNCHECKED-NEXT: ret
461 ; CHECKED-LABEL: test_resign_iza_db:
463 ; CHECKED-NEXT: mov x16, x0
464 ; CHECKED-NEXT: autiza x16
465 ; CHECKED-NEXT: mov x17, x16
466 ; CHECKED-NEXT: xpaci x17
467 ; CHECKED-NEXT: cmp x16, x17
468 ; CHECKED-NEXT: b.eq [[L]]auth_success_4
469 ; CHECKED-NEXT: mov x16, x17
470 ; CHECKED-NEXT: b [[L]]resign_end_4
471 ; CHECKED-NEXT: Lauth_success_4:
472 ; CHECKED-NEXT: pacdb x16, x2
473 ; CHECKED-NEXT: Lresign_end_4:
474 ; CHECKED-NEXT: mov x0, x16
477 ; TRAP-LABEL: test_resign_iza_db:
479 ; TRAP-NEXT: mov x16, x0
480 ; TRAP-NEXT: autiza x16
481 ; TRAP-NEXT: mov x17, x16
482 ; TRAP-NEXT: xpaci x17
483 ; TRAP-NEXT: cmp x16, x17
484 ; TRAP-NEXT: b.eq [[L]]auth_success_12
485 ; TRAP-NEXT: brk #0xc470
486 ; TRAP-NEXT: Lauth_success_12:
487 ; TRAP-NEXT: pacdb x16, x2
488 ; TRAP-NEXT: mov x0, x16
490 %tmp = call i64 @llvm.ptrauth.resign(i64 %arg, i32 0, i64 0, i32 3, i64 %arg2)
494 define i64 @test_resign_da_dzb(i64 %arg, i64 %arg1, i64 %arg2) {
495 ; UNCHECKED-LABEL: test_resign_da_dzb:
497 ; UNCHECKED-NEXT: mov x16, x0
498 ; UNCHECKED-NEXT: autda x16, x1
499 ; UNCHECKED-NEXT: pacdzb x16
500 ; UNCHECKED-NEXT: mov x0, x16
501 ; UNCHECKED-NEXT: ret
503 ; CHECKED-LABEL: test_resign_da_dzb:
505 ; CHECKED-NEXT: mov x16, x0
506 ; CHECKED-NEXT: autda x16, x1
507 ; CHECKED-NEXT: mov x17, x16
508 ; CHECKED-NEXT: xpacd x17
509 ; CHECKED-NEXT: cmp x16, x17
510 ; CHECKED-NEXT: b.eq [[L]]auth_success_5
511 ; CHECKED-NEXT: mov x16, x17
512 ; CHECKED-NEXT: b [[L]]resign_end_5
513 ; CHECKED-NEXT: Lauth_success_5:
514 ; CHECKED-NEXT: pacdzb x16
515 ; CHECKED-NEXT: Lresign_end_5:
516 ; CHECKED-NEXT: mov x0, x16
519 ; TRAP-LABEL: test_resign_da_dzb:
521 ; TRAP-NEXT: mov x16, x0
522 ; TRAP-NEXT: autda x16, x1
523 ; TRAP-NEXT: mov x17, x16
524 ; TRAP-NEXT: xpacd x17
525 ; TRAP-NEXT: cmp x16, x17
526 ; TRAP-NEXT: b.eq [[L]]auth_success_13
527 ; TRAP-NEXT: brk #0xc472
528 ; TRAP-NEXT: Lauth_success_13:
529 ; TRAP-NEXT: pacdzb x16
530 ; TRAP-NEXT: mov x0, x16
532 %tmp = call i64 @llvm.ptrauth.resign(i64 %arg, i32 2, i64 %arg1, i32 3, i64 0)
536 define i64 @test_auth_trap_attribute(i64 %arg, i64 %arg1) "ptrauth-auth-traps" {
537 ; UNCHECKED-LABEL: test_auth_trap_attribute:
539 ; UNCHECKED-NEXT: mov x16, x0
540 ; UNCHECKED-NEXT: autia x16, x1
541 ; UNCHECKED-NEXT: mov x0, x16
542 ; UNCHECKED-NEXT: ret
544 ; CHECKED-LABEL: test_auth_trap_attribute:
546 ; CHECKED-NEXT: mov x16, x0
547 ; CHECKED-NEXT: autia x16, x1
548 ; CHECKED-NEXT: mov x17, x16
549 ; CHECKED-NEXT: xpaci x17
550 ; CHECKED-NEXT: cmp x16, x17
551 ; CHECKED-NEXT: b.eq [[L]]auth_success_6
552 ; CHECKED-NEXT: brk #0xc470
553 ; CHECKED-NEXT: Lauth_success_6:
554 ; CHECKED-NEXT: mov x0, x16
557 ; TRAP-LABEL: test_auth_trap_attribute:
559 ; TRAP-NEXT: mov x16, x0
560 ; TRAP-NEXT: autia x16, x1
561 ; TRAP-NEXT: mov x17, x16
562 ; TRAP-NEXT: xpaci x17
563 ; TRAP-NEXT: cmp x16, x17
564 ; TRAP-NEXT: b.eq [[L]]auth_success_14
565 ; TRAP-NEXT: brk #0xc470
566 ; TRAP-NEXT: Lauth_success_14:
567 ; TRAP-NEXT: mov x0, x16
569 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 0, i64 %arg1)
573 define i64 @test_auth_ia_constdisc(i64 %arg) {
574 ; UNCHECKED-LABEL: test_auth_ia_constdisc:
576 ; UNCHECKED-NEXT: mov x16, x0
577 ; UNCHECKED-NEXT: mov x17, #256
578 ; UNCHECKED-NEXT: autia x16, x17
579 ; UNCHECKED-NEXT: mov x0, x16
580 ; UNCHECKED-NEXT: ret
582 ; CHECKED-LABEL: test_auth_ia_constdisc:
584 ; CHECKED-NEXT: mov x16, x0
585 ; CHECKED-NEXT: mov x17, #256
586 ; CHECKED-NEXT: autia x16, x17
587 ; CHECKED-NEXT: mov x0, x16
590 ; TRAP-LABEL: test_auth_ia_constdisc:
592 ; TRAP-NEXT: mov x16, x0
593 ; TRAP-NEXT: mov x17, #256
594 ; TRAP-NEXT: autia x16, x17
595 ; TRAP-NEXT: mov x17, x16
596 ; TRAP-NEXT: xpaci x17
597 ; TRAP-NEXT: cmp x16, x17
598 ; TRAP-NEXT: b.eq [[L]]auth_success_15
599 ; TRAP-NEXT: brk #0xc470
600 ; TRAP-NEXT: Lauth_success_15:
601 ; TRAP-NEXT: mov x0, x16
603 %tmp = call i64 @llvm.ptrauth.auth(i64 %arg, i32 0, i64 256)
607 define i64 @test_resign_da_constdisc(i64 %arg, i64 %arg1) {
608 ; UNCHECKED-LABEL: test_resign_da_constdisc:
610 ; UNCHECKED-NEXT: mov x16, x0
611 ; UNCHECKED-NEXT: autda x16, x1
612 ; UNCHECKED-NEXT: mov x17, #256
613 ; UNCHECKED-NEXT: pacda x16, x17
614 ; UNCHECKED-NEXT: mov x0, x16
615 ; UNCHECKED-NEXT: ret
617 ; CHECKED-LABEL: test_resign_da_constdisc:
619 ; CHECKED-NEXT: mov x16, x0
620 ; CHECKED-NEXT: autda x16, x1
621 ; CHECKED-NEXT: mov x17, x16
622 ; CHECKED-NEXT: xpacd x17
623 ; CHECKED-NEXT: cmp x16, x17
624 ; CHECKED-NEXT: b.eq [[L]]auth_success_7
625 ; CHECKED-NEXT: mov x16, x17
626 ; CHECKED-NEXT: b [[L]]resign_end_6
627 ; CHECKED-NEXT: Lauth_success_7:
628 ; CHECKED-NEXT: mov x17, #256
629 ; CHECKED-NEXT: pacda x16, x17
630 ; CHECKED-NEXT: Lresign_end_6:
631 ; CHECKED-NEXT: mov x0, x16
634 ; TRAP-LABEL: test_resign_da_constdisc:
636 ; TRAP-NEXT: mov x16, x0
637 ; TRAP-NEXT: autda x16, x1
638 ; TRAP-NEXT: mov x17, x16
639 ; TRAP-NEXT: xpacd x17
640 ; TRAP-NEXT: cmp x16, x17
641 ; TRAP-NEXT: b.eq [[L]]auth_success_16
642 ; TRAP-NEXT: brk #0xc472
643 ; TRAP-NEXT: Lauth_success_16:
644 ; TRAP-NEXT: mov x17, #256
645 ; TRAP-NEXT: pacda x16, x17
646 ; TRAP-NEXT: mov x0, x16
648 %tmp = call i64 @llvm.ptrauth.resign(i64 %arg, i32 2, i64 %arg1, i32 2, i64 256)
652 declare i64 @llvm.ptrauth.auth(i64, i32, i64)
653 declare i64 @llvm.ptrauth.resign(i64, i32, i64, i32, i64)