xref: /freebsd/bin/sh/tests/expansion/arith15.0 (revision 315ee00f)
1
2failures=0
3
4check() {
5	if [ $(($1)) != $2 ]; then
6		failures=$((failures+1))
7		echo "For $1, expected $2 actual $(($1))"
8	fi
9}
10
11XXX=-9223372036854775808
12check "XXX"		-9223372036854775808
13check "XXX - 1" 	9223372036854775807
14check "$XXX - 1"	9223372036854775807
15check "$XXX - 2"	9223372036854775806
16check "0x8000000000000000 == 0x7fffffffffffffff" \
17			0
18
19exit $((failures != 0))
20