1 # $FreeBSD: head/bin/sh/tests/expansion/arith2.0 209652 2010-07-02 21:31:24Z jilles $
6 if [ $(($1)) != $2 ]; then
7 failures=$((failures+1))
8 echo "For $1, expected $2 actual $(($1))"
21 check "4611686018427387904" 4611686018427387904
22 check "0x4000000000000000" 4611686018427387904
23 check "0400000000000000000000" 4611686018427387904
24 check "0x4Ab0000000000000" 5381801554707742720
27 # try out all operators
52 check "v>=40&&v<=44" 1
54 check "(v=42)&&(v+=1)==43" 1
56 check "(v=42)&&(v-=1)==41" 1
58 check "(v=42)&&(v*=2)==84" 1
60 check "(v=42)&&(v/=10)==4" 1
62 check "(v=42)&&(v%=10)==2" 1
64 check "(v=42)&&(v<<=1)==84" 1
66 check "(v=42)&&(v>>=2)==10" 1
68 check "(v=42)&&(v&=32)==32" 1
70 check "(v=42)&&(v^=32)==10" 1
72 check "(v=42)&&(v|=32)==42" 1
77 exit $((failures != 0))