brintos

brintos / llvm-project-archived public Read only

0
0
Text · 875 B · cb48a80 Raw
29 lines · c
1void foo() {}2 3int main() {4  //% self.filecheck("c", "blraa.c")5  // CHECK: stop reason = EXC_BAD_ACCESS6  // CHECK-NEXT: Note: Possible pointer authentication failure detected.7  // CHECK-NEXT: Found authenticated indirect branch at address=0x{{.*}} (blraa.c:[[@LINE+1]]:3).8  asm volatile (9      "mov x9, #0xbad \n"10      "blraa %[target], x9 \n"11      /* Outputs */  :12      /* Inputs */   : [target] "r"(&foo)13      /* Clobbers */ : "x9"14  );15 16  return 1;17}18 19// Expected codegen and exception message without ptrauth diagnostics:20// * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2000000100007f9c)21//     frame #0: 0x0000000100007f9c blraa2`foo22// blraa2`foo:23//     0x100007f9c <+0>: ret24//25// blraa2`main:26//     0x100007fa0 <+0>: nop27//     0x100007fa4 <+4>: ldr    x8, #0x5c28//     0x100007fa8 <+8>: mov    x9, #0xbad29