1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mindirect-branch=thunk-extern -mindirect-branch-register " } */
3 /* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */
4
5 typedef void (*dispatch_t)(long offset);
6
7 dispatch_t dispatch;
8
9 void
male_indirect_jump(long offset)10 male_indirect_jump (long offset)
11 {
12 dispatch(offset);
13 }
14
15 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
16 /* { dg-final { scan-assembler-not "push(?:l|q)\[ \t\]*_?dispatch" } } */
17 /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
18 /* { dg-final { scan-assembler-not {\t(pause|pause|nop)} } } */
19 /* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
20 /* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */
21