diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-5.c')
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-5.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-5.c b/gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-5.c new file mode 100644 index 000000000000..178ce26ff25f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-5.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-pic" } */ + +typedef void (*dispatch_t)(long offset); + +dispatch_t dispatch; +extern int male_indirect_jump (long) + __attribute__ ((indirect_branch("thunk-extern"))); + +int +male_indirect_jump (long offset) +{ + dispatch(offset); + return 0; +} + +/* { dg-final { scan-assembler "adrp\[ \t\]*x1, dispatch" } } */ +/* { dg-final { scan-assembler "ldr\[ \t\]*x1, \\\[x1, #:lo12:dispatch\\\]" } } */ +/* { dg-final { scan-assembler "bl\[ \t\]*__aarch64_indirect_thunk_x1" } } */ + +/* { dg-final { scan-assembler-not "bl\[ \t\]*\.LIND1" } } */ +/* { dg-final { scan-assembler-not "wfe" } } */ +/* { dg-final { scan-assembler-not "b\[ \t\]*\.LIND0" } } */ +/* { dg-final { scan-assembler-not "adr\[ \t\]*x30, .LIND2" } } */ |