x86: Add -mindirect-branch-register
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / ret-thunk-13.c
blob7a08e71c76bde1169177d7a7d0b770b05cf03a8f
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
4 extern void (*bar) (void);
5 extern int foo (void) __attribute__ ((function_return("thunk")));
7 int
8 foo (void)
10 bar ();
11 return 0;
14 /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */
15 /* { dg-final { scan-assembler-times {\tpause} 2 } } */
16 /* { dg-final { scan-assembler-times {\tlfence} 2 } } */
17 /* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?bar" { target { ! x32 } } } } */
18 /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 3 } } */
19 /* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 3 } } */
20 /* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_indirect_thunk" } } */
21 /* { dg-final { scan-assembler-not "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { x32 } } } } */
22 /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */