| 1 |
/* PR target/94514. Unwind across mixed pac-ret and non-pac-ret frames. */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-require-effective-target lp64 } */ |
| 4 |
|
| 5 |
__attribute__((noinline, target("branch-protection=pac-ret"))) |
| 6 |
static void do_throw (void) |
| 7 |
{ |
| 8 |
throw 42; |
| 9 |
__builtin_abort (); |
| 10 |
} |
| 11 |
|
| 12 |
__attribute__((noinline, target("branch-protection=none"))) |
| 13 |
static void no_pac_ret (void) |
| 14 |
{ |
| 15 |
do_throw (); |
| 16 |
__builtin_abort (); |
| 17 |
} |
| 18 |
|
| 19 |
int main () |
| 20 |
{ |
| 21 |
try { |
| 22 |
no_pac_ret (); |
| 23 |
} catch (...) { |
| 24 |
return 0; |
| 25 |
} |
| 26 |
__builtin_abort (); |
| 27 |
} |