aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-tailcall_0.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-tailcall_0.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-tailcall_0.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-tailcall_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-tailcall_0.c
new file mode 100644
index 000000000..285491445
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-tailcall_0.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O2 -fdump-tree-tailc -fdump-tree-optimized" } */
+__attribute__ ((noinline))
+int factorial(int x)
+{
+ if (x == 1)
+ return 1;
+ else
+ return x*factorial(--x);
+}
+int gbl;
+int
+main()
+{
+ gbl = factorial(100);
+ return 0;
+}
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "tailc"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "tailc" } } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */