1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep " } */
3 /* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */
4 
5 typedef void (*dispatch_t)(long offset);
6 
7 dispatch_t dispatch;
8 
9 extern void male_indirect_jump (long)
10   __attribute__ ((indirect_branch("thunk")));
11 
12 void
male_indirect_jump(long offset)13 male_indirect_jump (long offset)
14 {
15   dispatch(offset);
16 }
17 
18 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
19 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
20 /* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
21 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
22 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
23 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
24 /* { dg-final { scan-assembler {\tpause} } } */
25 /* { dg-final { scan-assembler {\tlfence} } } */
26