summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/nested-apcs.c
blob: 9dac3043e278a182da04d8333f820dffe5f46bca (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
32
33
34
/* { dg-do run } */
/* { dg-options "-fno-omit-frame-pointer -mapcs-frame -O" } */

extern void abort (void);

struct x
{
  int y;
  int z;
};

int __attribute__((noinline)) f (int c, int d, int e, int h, int i)
{
  int a;
  struct x b;

  int __attribute__((noinline)) g (int p, int q, int r, struct x s)
  {
    return a + p + q + r + s.y + s.z;
  }

  a = 5;
  b.y = h;
  b.z = i;

  return g(c, d, e, b);
}

int main(void)
{
  if (f (1, 2, 3, 4, 5) != 20)
    abort();
  return 0;
}