]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
-fuse-caller-save - Add test-case
authorRadovan Obradovic <robradovic@mips.com>
Thu, 24 Apr 2014 10:27:16 +0000 (10:27 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Thu, 24 Apr 2014 10:27:16 +0000 (10:27 +0000)
2014-04-24  Radovan Obradovic  <robradovic@mips.com>
            Tom de Vries  <tom@codesourcery.com>

* gcc.dg/fuse-caller-save.c: New test.

Co-Authored-By: Tom de Vries <tom@codesourcery.com>
From-SVN: r209745

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/fuse-caller-save.c [new file with mode: 0644]

index f0770c1f0e313f2d14e811926768bf633704dbf0..ff27827b2a0b83d3f3f4cc1873bc2b6f27f52ddd 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-24  Radovan Obradovic  <robradovic@mips.com>
+            Tom de Vries  <tom@codesourcery.com>
+
+       * gcc.dg/fuse-caller-save.c: New test.
+
 2014-04-24  Joey Ye  <joey.ye@arm.com>
 
        * 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 (file)
index 0000000..561a66d
--- /dev/null
@@ -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);
+}