summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
blob: 7abcf91e26dd8ae739be12f56322ea4847c337d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* { dg-do compile } */
/* { dg-options "-O2 -fipa-ra -fomit-frame-pointer -fno-optimize-sibling-calls" } */
/* { dg-additional-options "-mregparm=1" { target ia32 } } */

/* Test -fipa-ra optimization on self-recursive function.  */

static int __attribute__((noinline))
bar (int x)
{
  if (x > 4)
    return bar (x - 3);
  return 0;
}

int __attribute__((noinline))
foo (int y)
{
  return y + bar (y);
}

/* For !nonpic && ia32 xfails, see PR64895.  */

/* Check that no registers are saved/restored. */
/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */
/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */

/* Check that addition uses dx. */
/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */

/* Verify that bar is self-recursive.  */
/* { dg-final { scan-assembler-times "call\t_?bar" 2 } } */