tuned the liability of the license.
[muis.git] / debug.sh
blob99d77445892b37901115bec7801deea0b5fd1914
1 #!/bin/bash
2 # Compiles the file test.c and checks the output of the reference with the
3 # optimised version of the program. muis is the optimiser for this.
4 CC=xgcc
5 I386CC=gcc
6 CFLAGS=-O0
7 SIM="sim-outorder"
8 OPT=~/muis/muis/muis.py
9 OPTFLAGS=--agressive
10 IN=debug.c
12 X=true
14 $CC $CFLAGS -S $IN -o ref.s
15 $CC $CFLAGS ref.s -o ref
17 $OPT $OPTFLAGS ref.s opt.s || X=false
19 if $X
20 then
21 $CC $CFLAGS opt.s -o opt
23 echo simulating reference:
24 $SIM ref 2>/dev/null | tee debug.ref 2>/dev/null || true
25 echo
26 echo simulating optimised:
27 $SIM opt 2>/dev/null | tee debug.opt 2>/dev/null || true
29 test -n "`diff debug.ref debug.opt`" && X=false
32 $X && echo Success
33 $X || echo Failure