1/* { dg-do compile } */
2/* { dg-skip-if "no register windows" { *-*-* } { "-mflat" } { "" } } */
3/* { dg-require-effective-target ilp32 } */
4/* { dg-options "-mcpu=ultrasparc -O" } */
5
6/* Make sure that Ultrasparc return insn do not read below the stack.  */
7
8void toto (int *);
9
10int bar (int a, int b, int c, int d, int e, int f, int g, int h)
11{
12  int res;
13
14  toto (&res);
15  return h;
16}
17/* { dg-final { scan-assembler "return\[ \t\]*%i7\\+8\n\[^\n\]*ld\[ \t\]*\\\[%sp\\+96\\\]" } } */
18
19int bar2 ()
20{
21  int res;
22
23  toto (&res);
24  return res;
25}
26/* { dg-final { scan-assembler "return\[ \t\]*%i7\\+8\n\[^\n\]*nop" } } */
27