x86: Add -mindirect-branch-register
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / indirect-thunk-3.c
blob82973cda7719329aceeb680e943ffd009a612f96
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
4 typedef void (*dispatch_t)(long offset);
6 dispatch_t dispatch;
8 int
9 male_indirect_jump (long offset)
11 dispatch(offset);
12 return 0;
15 /* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */
16 /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */
17 /* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */
18 /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
19 /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
20 /* { dg-final { scan-assembler {\tpause} } } */
21 /* { dg-final { scan-assembler {\tlfence} } } */