1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
4 typedef void (*dispatch_t
)(long offset
);
6 dispatch_t dispatch
[256];
9 male_indirect_jump (long offset
)
11 dispatch
[offset
](offset
);
15 /* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */
16 /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */
17 /* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */
18 /* { dg-final { scan-assembler-times {\tpause} 1 } } */
19 /* { dg-final { scan-assembler-times {\tlfence} 1 } } */
20 /* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */
21 /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */