aboutsummaryrefslogtreecommitdiffstats
path: root/test/tailrecurse.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/tailrecurse.awk')
-rw-r--r--test/tailrecurse.awk15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/tailrecurse.awk b/test/tailrecurse.awk
new file mode 100644
index 00000000..b287d168
--- /dev/null
+++ b/test/tailrecurse.awk
@@ -0,0 +1,15 @@
+BEGIN {
+ abc(2)
+}
+
+
+function abc(c, A, B)
+{
+ print "abc(" c ", " length(A) ")"
+ if (! c--) {
+ return
+ }
+ B[""]
+ print length(B)
+ return abc(c, B)
+}