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