diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-6.c')
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-6.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-6.c b/gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-6.c new file mode 100644 index 000000000000..75964a058391 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/indirect-thunk-attr-6.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-pic" } */ + +typedef void (*dispatch_t)(long offset); + +dispatch_t dispatch[256]; + +__attribute__ ((indirect_branch("thunk-extern"))) +int +male_indirect_jump (long offset) +{ + dispatch[offset](offset); + return 0; +} + +/* { dg-final { scan-assembler "adrp\[ \t\]*x1, dispatch" } } */ +/* { dg-final { scan-assembler "add\[ \t\]*x1, x1, :lo12:dispatch" } } */ +/* { dg-final { scan-assembler "ldr\[ \t\]*x1, \\\[x1, x0, lsl 3\\\]" } } */ +/* { 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" } } */ |