aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/tests/builtins/trap10.0
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/tests/builtins/trap10.0')
-rw-r--r--bin/sh/tests/builtins/trap10.06
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/sh/tests/builtins/trap10.0 b/bin/sh/tests/builtins/trap10.0
new file mode 100644
index 000000000000..fa0e35d6a6b2
--- /dev/null
+++ b/bin/sh/tests/builtins/trap10.0
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+# Check that the return statement will not break the EXIT trap, ie. all
+# trap commands are executed before the script exits.
+
+test "$(trap 'printf trap; echo ped' EXIT; f() { return; }; f)" = trapped || exit 1