Add option to force indirect calls for x86
[gcc.git] / gcc / testsuite / gcc.target / i386 / force-indirect-call-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mforce-indirect-call" } */
3 /* { dg-final { scan-assembler-times "call\[ \\t\]+\\*%" 2 } } */
4 /* { dg-final { scan-assembler-times "jmp\[ \\t\]+\\*%" 1 } } */
5 int x;
6 int y;
7
8 void __attribute__((noinline)) f1(void)
9 {
10 x++;
11 }
12
13 static __attribute__((noinline)) void f3(void)
14 {
15 y++;
16 }
17
18 void f2()
19 {
20 f1();
21 f3();
22 f1();
23 }