summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c
new file mode 100644
index 00000000000..7f3415444ff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+/* Test provided by Richard Earnshaw in PR 14312. */
+
+void bar (int i);
+void baz (int *);
+
+void
+foo (int *x)
+{
+ if (*x < 0)
+ {
+ baz (x);
+ return;
+ }
+ bar (*x);
+}
+
+/* The test has no local call-clobbered variables. Only the memory
+ tag for 'x' is call-clobbered. And since tags are not real
+ variables, they ought to be ignored. There should be two tail
+ calls here. */
+/* { dg-final { scan-tree-dump-times "Found tail call" 2 "tailc"} } */