32 lines · c
1int main() {2 //% self.filecheck("c", "ldraa.c")3 // CHECK: EXC_BAD_ACCESS4 // CHECK-NEXT: Note: Possible pointer authentication failure detected.5 // CHECK-NEXT: Found authenticated load instruction at address=0x{{.*}} (ldraa.c:[[@LINE+3]]:3).6 long long foo = 0;7 8 asm volatile (9 "ldraa x9, [%[target]] \n"10 /* Outputs */ :11 /* Inputs */ : [target] "r"(&foo)12 /* Clobbers */ :13 );14 15 return 1;16}17 18// Expected codegen, register state, and exception message without ptrauth diagnostics:19// * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2000016fdffc38)20// frame #0: 0x0000000100007fa8 ldraa`main + 1221// ldraa`main:22// -> 0x100007fa8 <+12>: ldraa x9, [x8]23// 0x100007fac <+16>: orr w0, wzr, #0x124// 0x100007fb0 <+20>: add sp, sp, #0x10 ; =0x1025// 0x100007fb4 <+24>: ret26// Target 0: (ldraa) stopped.27// (lldb) p/x $x828// (unsigned long) $0 = 0x000000016fdffc3829// (lldb) x/8 $x830// 0x16fdffc38: 0x00000000 0x00000000 0x80254f30 0x0000000131// 0x16fdffc48: 0x00000000 0x00000000 0x00000000 0x0000000032