xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/fcall_exit.awk (revision 5328fc53d11d7151861fa272e4fb0248b8f0e145)
1#!/bin/awk -f
2
3function crash () {
4    exit 1
5}
6
7function true (a,b,c) {
8    return 0
9}
10
11BEGIN {
12    if (ARGV[1] == 1) {
13        print "true(1, 1, crash()) => crash properly."
14        true(1, 1, crash())
15    } else if (ARGV[1] == 2) {
16        print "true(1, crash(), 1) => do not crash properly."
17        true(1, crash(),1)
18    } else {
19        print "true(1, crash()) => do not crash properly."
20        true(1, crash())
21    }
22}
23
24# FdF
25