Author: jilles
Date: Wed Jul  3 21:43:41 2013
New Revision: 252613
URL: http://svnweb.freebsd.org/changeset/base/252613

Log:
  MFC r245383,245392,247190,249220,251180,251797: New sh testcases.
  
  These already work on stable/9.

Added:
  stable/9/tools/regression/bin/sh/builtins/break4.4
     - copied unchanged from r251180, 
head/tools/regression/bin/sh/builtins/break4.4
  stable/9/tools/regression/bin/sh/builtins/break5.4
     - copied unchanged from r251180, 
head/tools/regression/bin/sh/builtins/break5.4
  stable/9/tools/regression/bin/sh/builtins/eval6.0
     - copied unchanged from r249220, 
head/tools/regression/bin/sh/builtins/eval6.0
  stable/9/tools/regression/bin/sh/builtins/local2.0
     - copied unchanged from r251797, 
head/tools/regression/bin/sh/builtins/local2.0
  stable/9/tools/regression/bin/sh/builtins/local3.0
     - copied unchanged from r251797, 
head/tools/regression/bin/sh/builtins/local3.0
  stable/9/tools/regression/bin/sh/builtins/read6.0
     - copied unchanged from r247190, 
head/tools/regression/bin/sh/builtins/read6.0
  stable/9/tools/regression/bin/sh/execution/subshell1.0
     - copied unchanged from r245383, 
head/tools/regression/bin/sh/execution/subshell1.0
  stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout
     - copied unchanged from r245383, 
head/tools/regression/bin/sh/execution/subshell1.0.stdout
  stable/9/tools/regression/bin/sh/execution/subshell2.0
     - copied unchanged from r245383, 
head/tools/regression/bin/sh/execution/subshell2.0
  stable/9/tools/regression/bin/sh/execution/subshell3.0
     - copied unchanged from r245383, 
head/tools/regression/bin/sh/execution/subshell3.0
  stable/9/tools/regression/bin/sh/execution/subshell4.0
     - copied unchanged from r245383, 
head/tools/regression/bin/sh/execution/subshell4.0
  stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0
     - copied unchanged from r245392, 
head/tools/regression/bin/sh/expansion/cmdsubst16.0
Modified:
Directory Properties:
  stable/9/tools/regression/bin/sh/   (props changed)

Copied: stable/9/tools/regression/bin/sh/builtins/break4.4 (from r251180, 
head/tools/regression/bin/sh/builtins/break4.4)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/builtins/break4.4  Wed Jul  3 21:43:41 
2013        (r252613, copy of r251180, 
head/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

Copied: stable/9/tools/regression/bin/sh/builtins/break5.4 (from r251180, 
head/tools/regression/bin/sh/builtins/break5.4)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/builtins/break5.4  Wed Jul  3 21:43:41 
2013        (r252613, copy of r251180, 
head/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

Copied: stable/9/tools/regression/bin/sh/builtins/eval6.0 (from r249220, 
head/tools/regression/bin/sh/builtins/eval6.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/builtins/eval6.0   Wed Jul  3 21:43:41 
2013        (r252613, copy of r249220, 
head/tools/regression/bin/sh/builtins/eval6.0)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+# eval should preserve $? from command substitutions when starting
+# the parsed command.
+[ $(false; eval 'echo $?' $(:)) = 0 ]

Copied: stable/9/tools/regression/bin/sh/builtins/local2.0 (from r251797, 
head/tools/regression/bin/sh/builtins/local2.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/builtins/local2.0  Wed Jul  3 21:43:41 
2013        (r252613, copy of r251797, 
head/tools/regression/bin/sh/builtins/local2.0)
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+f() {
+       local -
+       set -a
+       case $- in
+       *a*) : ;;
+       *) echo In-function \$- bad
+       esac
+}
+case $- in
+*a*) echo Initial \$- bad
+esac
+f
+case $- in
+*a*) echo Final \$- bad
+esac

Copied: stable/9/tools/regression/bin/sh/builtins/local3.0 (from r251797, 
head/tools/regression/bin/sh/builtins/local3.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/builtins/local3.0  Wed Jul  3 21:43:41 
2013        (r252613, copy of r251797, 
head/tools/regression/bin/sh/builtins/local3.0)
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+f() {
+       local "$@"
+       set -a
+       x=7
+       case $- in
+       *a*) : ;;
+       *) echo In-function \$- bad
+       esac
+       [ "$x" = 7 ] || echo In-function \$x bad
+}
+x=1
+case $- in
+*a*) echo Initial \$- bad
+esac
+f x -
+case $- in
+*a*) echo Intermediate \$- bad
+esac
+[ "$x" = 1 ] || echo Intermediate \$x bad
+f - x
+case $- in
+*a*) echo Final \$- bad
+esac
+[ "$x" = 1 ] || echo Final \$x bad

Copied: stable/9/tools/regression/bin/sh/builtins/read6.0 (from r247190, 
head/tools/regression/bin/sh/builtins/read6.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/builtins/read6.0   Wed Jul  3 21:43:41 
2013        (r252613, copy of r247190, 
head/tools/regression/bin/sh/builtins/read6.0)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+: | read x
+r=$?
+[ "$r" = 1 ]

Copied: stable/9/tools/regression/bin/sh/execution/subshell1.0 (from r245383, 
head/tools/regression/bin/sh/execution/subshell1.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/execution/subshell1.0      Wed Jul  3 
21:43:41 2013        (r252613, copy of r245383, 
head/tools/regression/bin/sh/execution/subshell1.0)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+(eval "cd /
+v=$(printf %0100000d 1)
+echo \${#v}")
+echo end

Copied: stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout (from 
r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout       Wed Jul 
 3 21:43:41 2013        (r252613, copy of r245383, 
head/tools/regression/bin/sh/execution/subshell1.0.stdout)
@@ -0,0 +1,2 @@
+100000
+end

Copied: stable/9/tools/regression/bin/sh/execution/subshell2.0 (from r245383, 
head/tools/regression/bin/sh/execution/subshell2.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/execution/subshell2.0      Wed Jul  3 
21:43:41 2013        (r252613, copy of r245383, 
head/tools/regression/bin/sh/execution/subshell2.0)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+f() {
+       x=2
+}
+(
+       x=1
+       f
+       [ "$x" = 2 ]
+)

Copied: stable/9/tools/regression/bin/sh/execution/subshell3.0 (from r245383, 
head/tools/regression/bin/sh/execution/subshell3.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/execution/subshell3.0      Wed Jul  3 
21:43:41 2013        (r252613, copy of r245383, 
head/tools/regression/bin/sh/execution/subshell3.0)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+(false; exit) && exit 3
+exit 0

Copied: stable/9/tools/regression/bin/sh/execution/subshell4.0 (from r245383, 
head/tools/regression/bin/sh/execution/subshell4.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/execution/subshell4.0      Wed Jul  3 
21:43:41 2013        (r252613, copy of r245383, 
head/tools/regression/bin/sh/execution/subshell4.0)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+(eval "set v=1"; false) && echo bad; :

Copied: stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 (from r245392, 
head/tools/regression/bin/sh/expansion/cmdsubst16.0)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0     Wed Jul  3 
21:43:41 2013        (r252613, copy of r245392, 
head/tools/regression/bin/sh/expansion/cmdsubst16.0)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+f() { return 3; }
+f
+[ `echo $?` = 3 ]
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to