2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / fuse-caller-save-rec.c
blob7abcf91e26dd8ae739be12f56322ea4847c337d9
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fipa-ra -fomit-frame-pointer -fno-optimize-sibling-calls" } */
3 /* { dg-additional-options "-mregparm=1" { target ia32 } } */
5 /* Test -fipa-ra optimization on self-recursive function. */
7 static int __attribute__((noinline))
8 bar (int x)
10 if (x > 4)
11 return bar (x - 3);
12 return 0;
15 int __attribute__((noinline))
16 foo (int y)
18 return y + bar (y);
21 /* For !nonpic && ia32 xfails, see PR64895. */
23 /* Check that no registers are saved/restored. */
24 /* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
25 /* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */
27 /* Check that addition uses dx. */
28 /* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */
30 /* Verify that bar is self-recursive. */
31 /* { dg-final { scan-assembler-times "call\t_?bar" 2 } } */