xref: /freebsd/bin/sh/tests/expansion/arith16.0 (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
1# $FreeBSD$
2
3failures=0
4
5for x in \
6	0x10000000000000000 \
7	-0x8000000000000001 \
8	0xfffffffffffffffffffffffffffffffff \
9	-0xfffffffffffffffffffffffffffffffff \
10	02000000000000000000000 \
11	9223372036854775808 \
12	9223372036854775809 \
13	-9223372036854775809 \
14	9999999999999999999999999 \
15	-9999999999999999999999999
16do
17	msg=$({
18		v=$((x)) || :
19	} 3>&1 >&2 2>&3 3>&-)
20	r=$?
21	if [ "$r" = 0 ] || [ -z "$msg" ]; then
22		printf 'Failed: %s\n' "$x"
23		: $((failures += 1))
24	fi
25done
26exit $((failures > 0))
27