From a0dc7e84cff2c39510d98dd9a1fadfc44052b0a7 Mon Sep 17 00:00:00 2001 From: jilles Date: Sun, 22 Aug 2010 11:04:30 +0000 Subject: sh: Add a test for breaking from a loop outside the current function. It is unwise to rely on this but I'd like to know if this would break. --- tools/regression/bin/sh/builtins/break3.0 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tools/regression/bin/sh/builtins/break3.0 diff --git a/tools/regression/bin/sh/builtins/break3.0 b/tools/regression/bin/sh/builtins/break3.0 new file mode 100644 index 0000000..10a5ca8 --- /dev/null +++ b/tools/regression/bin/sh/builtins/break3.0 @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# We accept this and people might rely on it. +# However, various other shells do not accept it. + +f() { + break + echo bad1 +} + +while :; do + f + echo bad2 + exit 2 +done -- cgit v1.1