xref: /llvm-project/lldb/test/API/functionalities/ptrauth_diagnostics/brkC47x_code/brkC47x.c (revision 66902a32c83809d26662f76e4107d5dd777610c3)

foo()1 void foo() {}
2 
main()3 int main() {
4   //% self.filecheck("c", "brkC47x.c")
5   // CHECK: stop reason = EXC_BAD_ACCESS
6   // CHECK-NEXT: Note: Possible pointer authentication failure detected.
7   // CHECK-NEXT: Found value that failed to authenticate at address=0x{{.*}} (brkC47x.c:1:13).
8   asm volatile (
9       "mov x16, %[target] \n"
10       "brk 0xc470 \n"
11       /* Outputs */  :
12       /* Inputs */   : [target] "r"(&foo)
13       /* Clobbers */ : "x16"
14   );
15 
16   return 1;
17 }
18