summaryrefslogtreecommitdiffstats
path: root/tools/regression
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-05-31 14:45:25 +0000
committerjilles <jilles@FreeBSD.org>2013-05-31 14:45:25 +0000
commit39d8d22f105aa44916cd71ed8a035e44d10e8fc6 (patch)
treee35ec4ede45031bdbf31f180b9d828e4096dddfd /tools/regression
parent8e4a664c2cd6b450743448f7c260c36ece78012b (diff)
downloadFreeBSD-src-39d8d22f105aa44916cd71ed8a035e44d10e8fc6.zip
FreeBSD-src-39d8d22f105aa44916cd71ed8a035e44d10e8fc6.tar.gz
sh: Add test cases for break outside a loop.
In most shells (including our sh), break outside a loop does nothing with status 0, or at least does not abort. Therefore, scripts sometimes (buggily) depend on this.
Diffstat (limited to 'tools/regression')
-rw-r--r--tools/regression/bin/sh/builtins/break4.47
-rw-r--r--tools/regression/bin/sh/builtins/break5.412
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/break4.4 b/tools/regression/bin/sh/builtins/break4.4
new file mode 100644
index 0000000..d52ff52
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/break4.4
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0)
+# appear to depend on it.
+
+break
+exit 4
diff --git a/tools/regression/bin/sh/builtins/break5.4 b/tools/regression/bin/sh/builtins/break5.4
new file mode 100644
index 0000000..7df8e18
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/break5.4
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0)
+# appear to depend on it.
+# In some uncommitted code, the subshell environment corrupted the outer
+# shell environment's state.
+
+(for i in a b c; do
+ exit 3
+done)
+break
+exit 4
OpenPOWER on IntegriCloud