From 4607d3700e024777a54f16ad4306fd9fef96b6b9 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Tue, 24 Nov 2015 22:11:27 +0000 Subject: [PATCH] frame-header-4.c: New test. 2015-11-24 Steve Ellcey * gcc.target/mips/frame-header-4.c: New test. From-SVN: r230846 --- gcc/testsuite/ChangeLog | 4 ++++ .../gcc.target/mips/frame-header-4.c | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/gcc.target/mips/frame-header-4.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5c229ceb4f2..5b240482457 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-11-24 Steve Ellcey + + * gcc.target/mips/frame-header-4.c: New test. + 2015-11-24 Steven G. Kargl 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 index 00000000000..3cddba14de5 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/frame-header-4.c @@ -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); +} + -- 2.30.2