x86: Add -mindirect-branch-register
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / indirect-thunk-inline-4.c
blob7b3983949d2243edf3ce4142ecc6de177e4da140
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];
8 int
9 male_indirect_jump (long offset)
11 dispatch[offset](offset);
12 return 0;
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 } } } */