frame-header-4.c: New test.
authorSteve Ellcey <sellcey@imgtec.com>
Tue, 24 Nov 2015 22:11:27 +0000 (22:11 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Tue, 24 Nov 2015 22:11:27 +0000 (22:11 +0000)
2015-11-24  Steve Ellcey  <sellcey@imgtec.com>

* gcc.target/mips/frame-header-4.c: New test.

From-SVN: r230846

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/frame-header-4.c [new file with mode: 0644]

index 5c229ceb4f2f2b3d8a6e4fc5d7a8538e3cf1fc82..5b24048245757c260abe707bcf7113b319621cca 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-24  Steve Ellcey  <sellcey@imgtec.com>
+
+       * gcc.target/mips/frame-header-4.c: New test.
+
 2015-11-24  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/68486
diff --git a/gcc/testsuite/gcc.target/mips/frame-header-4.c b/gcc/testsuite/gcc.target/mips/frame-header-4.c
new file mode 100644 (file)
index 0000000..3cddba1
--- /dev/null
@@ -0,0 +1,20 @@
+/* Verify that we can optimize away the frame header allocation in bar
+   by having it use its frame header to store $31 in before calling foo.  */
+
+/* { dg-do compile } */
+/* { dg-options "-mframe-header-opt -mabi=32" } */
+/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
+/* { dg-final { scan-assembler-not "\taddiu\t\\\$sp" } } */
+
+int __attribute__ ((noinline))
+foo (int a, int b)
+{
+       return a + b;
+}
+
+int  __attribute__ ((noinline))
+bar (int a, int b)
+{
+       return 1 + foo(a,b);
+}
+