summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c
new file mode 100644
index 00000000000..c2a85940a30
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+int q(int a);
+int *v;
+int
+t(int a)
+{
+ int r,r1;
+ if (a)
+ r1=r = q(a-1);
+ else
+ return 0;
+ /* Dead alloca should not disturb us. */
+ if (r!=r1)
+ v=alloca(r);
+ return r;
+}
+/* { dg-final { scan-tree-dump-times "Found tail call" 1 "tailc"} } */