xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/sparc-ret.c (revision 4e43c760ad4cd5f644ec700462679d05749498d8)
1 /* Copyright (C) 2001  Free Software Foundation.
2 
3    Making sure that Ultrasparc return instructions do not read
4    below the stack.  */
5 
6 /* { dg-do compile { target sparc-*-* } } */
7 /* { dg-options "-mcpu=ultrasparc -O" } */
8 
9 
bar(int a,int b,int c,int d,int e,int f,int g,int h)10 int 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 { global compiler_flags; if ![string match "*-m64 *" $compiler_flags] { scan-assembler "return\[ \t\]*%i7\\+8\n\[^\n\]*ld\[ \t\]*\\\[%sp\\+96\\\]" } } } */
18 
bar2()19 int bar2 ()
20 {
21   int res;
22 
23   toto (&res);
24   return res;
25 }
26 /* { dg-final { global compiler_flags; if ![string match "*-m64 *" $compiler_flags] { scan-assembler "return\[ \t\]*%i7\\+8\n\[^\n\]*nop" } } } */
27