1 # RUN: llvm-mc -triple=arm64e-apple-macosx -filetype=obj -o %t.o %s
2 # RUN: llvm-jitlink %t.o
4 # REQUIRES: system-darwin && host=arm64{{.*}}
6 # Check that arm64e ptrauth relocations are handled correctly.
8 # This test contains eight global pointers with different signing schemes
9 # (IA vs DA key, with and without address diversity, and with 0 or 0xa5a5 as
10 # the additional diversity value). If all pointers pass authentication at
11 # runtime then the test returns zero.
13 # This test requires execution since the signed pointers are written by a
14 # signing function attached to the graph.
16 # TODO: Write an out-of-process version. This will probably need to be added to
19 .section __TEXT,__text,regular,pure_instructions
20 .build_version macos, 13, 0 sdk_version 13, 3
25 ldr x16
, [x8
, _p1@PAGEOFF
]
29 add x9
, x9
, _p2@PAGEOFF
34 ldr x16
, [x10
, _p3@PAGEOFF
]
39 add x9
, x9
, _p4@PAGEOFF
42 movk x17
, #23130, lsl #48
46 ldr x10
, [x10
, _p5@PAGEOFF
]
50 add x9
, x9
, _p6@PAGEOFF
55 ldr x16
, [x10
, _p7@PAGEOFF
]
60 add x9
, x9
, _p8@PAGEOFF
63 movk x17
, #23130, lsl #48
70 .section __DATA,__data
126 .quad _b@AUTH(ia,0,addr)
131 .quad _c@AUTH(ia,23130)
136 .quad _d@AUTH(ia,23130,addr)
146 .quad _f@AUTH(da,0,addr)
151 .quad _g@AUTH(da,23130)
156 .quad _h@AUTH(da,23130,addr)
158 .subsections_via_symbols