sh: Add testcases that should not be broken by future optimizations.
This commit is contained in:
parent
93431cb74c
commit
d0766f8d45
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230121
6
tools/regression/bin/sh/expansion/cmdsubst12.0
Normal file
6
tools/regression/bin/sh/expansion/cmdsubst12.0
Normal file
@ -0,0 +1,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
f() {
|
||||
echo x$(printf foo >&2)y
|
||||
}
|
||||
[ "$(f 2>&1)" = "fooxy" ]
|
12
tools/regression/bin/sh/expansion/cmdsubst13.0
Normal file
12
tools/regression/bin/sh/expansion/cmdsubst13.0
Normal file
@ -0,0 +1,12 @@
|
||||
# $FreeBSD$
|
||||
|
||||
x=1 y=2
|
||||
[ "$(
|
||||
case $((x+=1)) in
|
||||
($((y+=1))) echo bad1 ;;
|
||||
($((y-1))) echo $x.$y ;;
|
||||
($((y=2))) echo bad2 ;;
|
||||
(*) echo bad3 ;;
|
||||
esac
|
||||
)" = "2.3" ] || echo "Error at $LINENO"
|
||||
[ "$x.$y" = "1.2" ] || echo "Error at $LINENO"
|
Loading…
Reference in New Issue
Block a user