qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 61309852742548b496d222cf4e3f2c5e1569e6dd
parent 7ba69be87b3910cac2a8cd1cfe021e58f57f58d7
Author: Quentin Carbonneaux <quentin@c9x.me>
Date:   Sun,  5 May 2019 16:04:14 +0200

add asm diffing in test script

Diffstat:
Mtools/test.sh | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/tools/test.sh b/tools/test.sh @@ -2,11 +2,13 @@ dir=`cd $(dirname "$0"); pwd` bin=$dir/../obj/qbe +binref=$dir/../obj/qbe.ref tmp=/tmp/qbe.zzzz drv=$tmp.c asm=$tmp.s +asmref=$tmp.ref.s exe=$tmp.exe out=$tmp.out @@ -109,6 +111,11 @@ once() { return 1 fi + if test -x $binref + then + $binref -o $asmref $t 2>/dev/null + fi + extract driver $t > $drv extract output $t > $out @@ -143,6 +150,14 @@ once() { fi echo "[ok]" + + if test -f $asmref && ! cmp -s $asm $asmref + then + loc0=`wc -l $asm | cut -d' ' -f1` + loc1=`wc -l $asmref | cut -d' ' -f1` + printf " asm diff: %+d\n" $(($loc0 - $loc1)) + return 0 + fi } #trap cleanup TERM QUIT