From 60a9bb6172cb069b1ee00d9edd782d686845b50f Mon Sep 17 00:00:00 2001 From: Radovan Obradovic Date: Thu, 24 Apr 2014 10:27:16 +0000 Subject: [PATCH] -fuse-caller-save - Add test-case 2014-04-24 Radovan Obradovic Tom de Vries * gcc.dg/fuse-caller-save.c: New test. Co-Authored-By: Tom de Vries From-SVN: r209745 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/fuse-caller-save.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/fuse-caller-save.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f0770c1f0e3..ff27827b2a0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-04-24 Radovan Obradovic + Tom de Vries + + * gcc.dg/fuse-caller-save.c: New test. + 2014-04-24 Joey Ye * g++.dg/cpp0x/nsdmi-union5.C: Change to runtime test. diff --git a/gcc/testsuite/gcc.dg/fuse-caller-save.c b/gcc/testsuite/gcc.dg/fuse-caller-save.c new file mode 100644 index 00000000000..561a66dd7e4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fuse-caller-save.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-options "-fuse-caller-save" } */ +/* Testing -fuse-caller-save optimization option. */ + +static int __attribute__((noinline)) +bar (int x) +{ + return x + 3; +} + +int __attribute__((noinline)) +foo (int y) +{ + return y + bar (y); +} + +int +main (void) +{ + return !(foo (5) == 13); +}