diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/sparc/sparc-ret-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/sparc-ret-1.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/sparc/sparc-ret-1.c b/gcc/testsuite/gcc.target/sparc/sparc-ret-1.c new file mode 100644 index 00000000000..808e8a98f0e --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/sparc-ret-1.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-skip-if "no register windows" { *-*-* } { "-mflat" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-mcpu=ultrasparc -O" } */ + +/* Make sure that Ultrasparc return insn do not read below the stack. */ + +void toto (int *); + +int bar (int a, int b, int c, int d, int e, int f, int g, int h) +{ + int res; + + toto (&res); + return h; +} +/* { dg-final { scan-assembler "return\[ \t\]*%i7\\+8\n\[^\n\]*ld\[ \t\]*\\\[%sp\\+96\\\]" } } */ + +int bar2 () +{ + int res; + + toto (&res); + return res; +} +/* { dg-final { scan-assembler "return\[ \t\]*%i7\\+8\n\[^\n\]*nop" } } */ |