| 1 |
/* { dg-options "-O2 -fno-schedule-insns -fno-schedule-insns2 -mbranch-protection=gcs" } */ |
| 2 |
/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {\.L[0-9]+\:} } } */ |
| 3 |
|
| 4 |
void run (void (*)()); |
| 5 |
|
| 6 |
/* |
| 7 |
** bar.0: |
| 8 |
** ... |
| 9 |
** hint 40 // chkfeat x16 |
| 10 |
** tbnz w16, 0, (\.L[0-9]+) |
| 11 |
** ... |
| 12 |
** mrs (x[0-9]+), s3_3_c2_c5_1 // gcspr_el0 |
| 13 |
** subs x[0-9]+, x[0-9]+, \2 |
| 14 |
** bne (\.L[0-9]+)\n\1\: |
| 15 |
** ... |
| 16 |
** br x[0-9]+\n\3\: |
| 17 |
** ... |
| 18 |
** sysl xzr, #3, c7, c7, #1 // gcspopm |
| 19 |
** ... |
| 20 |
** b \1 |
| 21 |
*/ |
| 22 |
int |
| 23 |
foo (int *ptr) |
| 24 |
{ |
| 25 |
__label__ failure; |
| 26 |
|
| 27 |
void bar () { *ptr += 1; goto failure; } |
| 28 |
run (bar); |
| 29 |
return 1; |
| 30 |
|
| 31 |
failure: |
| 32 |
return 0; |
| 33 |
} |