diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c b/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c new file mode 100644 index 00000000000..097a1de0e4e --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-tailr-details" } */ +int +t(int a) +{ + int r; + if (a) + r = t(a-1); + else + return 0; + if (r) + r=r; + return r; +} +/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr"} } */ |