18 for p
in aarch64-linux-musl aarch64-linux-gnu
20 cc
="$p-gcc -no-pie -static"
23 $cc -v >/dev
/null
2>&1 &&
24 $qemu -version >/dev
/null
2>&1
26 if sysroot
=$
($cc -print-sysroot) && test -n "$sysroot"
28 qemu
="$qemu -L $sysroot"
36 echo "Cannot find arm64 compiler or qemu."
42 for p
in riscv64-linux-musl riscv64-linux-gnu
44 cc
="$p-gcc -no-pie -static"
47 $cc -v >/dev
/null
2>&1 &&
48 $qemu -version >/dev
/null
2>&1
50 if sysroot
=$
($cc -print-sysroot) && test -n "$sysroot"
52 qemu
="$qemu -L $sysroot"
60 echo "Cannot find riscv64 compiler or qemu."
71 cc
="cc -nopie -lpthread"
84 echo "Unknown target '$TARGET'."
91 rm -f $drv $asm $exe $out
117 echo "invalid test file $t" >&2
123 grep "skip.* $TARGET\( .*\)\?$" \
129 printf "%-45s" "$(basename $t)..."
139 $binref -o $asmref $t 2>/dev
/null
142 extract driver
$t > $drv
143 extract output
$t > $out
152 if ! $cc -g -o $exe $src $ccpost
160 $qemu $exe a b c |
diff -u - $out
166 reason
="returned $ret"
171 echo "[$reason fail]"
177 if test -f $asmref && ! cmp -s $asm $asmref
179 loc0
=`wc -l $asm | cut -d' ' -f1`
180 loc1
=`wc -l $asmref | cut -d' ' -f1`
181 printf " asm diff: %+d\n" $
(($loc0 - $loc1))
186 #trap cleanup TERM QUIT
192 echo "usage: tools/test.sh {all, SSAFILE}" 2>&1
200 for t
in $dir/..
/test
/[!_
]*.ssa
203 fail
=`expr $fail + $?`
204 count
=`expr $count + 1`
209 echo "$fail of $count tests failed!"