summaryrefslogtreecommitdiff
path: root/test/fcall_exit.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/fcall_exit.awk')
-rw-r--r--test/fcall_exit.awk24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/fcall_exit.awk b/test/fcall_exit.awk
new file mode 100644
index 00000000..931b6073
--- /dev/null
+++ b/test/fcall_exit.awk
@@ -0,0 +1,24 @@
+#!/bin/awk -f
+
+function crash () {
+ exit 1
+}
+
+function true (a,b,c) {
+ return 0
+}
+
+BEGIN {
+ if (ARGV[1] == 1) {
+ print "true(1, 1, crash()) => crash properly."
+ true(1, 1, crash())
+ } else if (ARGV[1] == 2) {
+ print "true(1, crash(), 1) => do not crash properly."
+ true(1, crash(),1)
+ } else {
+ print "true(1, crash()) => do not crash properly."
+ true(1, crash())
+ }
+}
+
+# FdF