Revert 'require nonpic target' for fuse-caller-save*.c
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / fuse-caller-save.c
blob7cfd22afeb2600e063ad804fd355ae692244a6c4
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fipa-ra -fomit-frame-pointer" } */
3 /* { dg-additional-options "-mregparm=1" { target ia32 } } */
5 /* Testing -fipa-ra optimization option. */
7 static int __attribute__((noinline))
8 bar (int x)
10 return x + 3;
13 int __attribute__((noinline))
14 foo (int y)
16 return y + bar (y);
19 /* Check that no registers are saved/restored. */
20 /* { dg-final { scan-assembler-not "push" } } */
21 /* { dg-final { scan-assembler-not "pop" } } */
23 /* PR61605. If the first argument register and the return register differ, then
24 bar leaves the first argument register intact. That means in foo that the
25 first argument register still contains y after bar has been called, and
26 there's no need to copy y to a different register before the call, to be able
27 to use it after the call.
28 Check that the copy is absent. */
29 /* { dg-final { scan-assembler-not "movl" { target { ! ia32 } } } } */
31 /* Check that addition uses di (in case of no copy) or dx (in case of copy). */
32 /* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 } } */