- Romcc preprocessor bug fixes, (The code size went down about 350 lines.. :)
[coreboot.git] / util / romcc / tests.sh
1 #!/bin/sh
2 # Allow core dumps
3 ulimit -c hard
4 set -x
5 N=''
6 root=simple_test
7 #root=simple_test
8 #root=linux_test
9 #root=raminit_test
10 if [ -n "$2" -a -n "$1" ] ; then
11     root=$1
12         N=$2
13 elif [ -n "$1" ] ; then
14         root=$1
15 else
16         echo "too few arguments"
17         exit 1
18 fi
19 ROMCC=./romcc
20 stem="$root$N"
21 base=tests/$stem
22 op="-Itests/include"
23 op="$op -feliminate-inefectual-code -fsimplify -fscc-transform "
24 #op="$op -O2"
25 op="$op -finline-policy=defaulton"
26 #op="$op -finline-policy=nopenalty"
27 #op="$op -finline-policy=never"
28 op="$op -fdebug -fdebug-triples -fdebug-interference  -fdebug-verification"
29 #op="$op -fdebug-inline"
30 #op="$op -fdebug-calls"
31 #op="$op -mnoop-copy"
32 #op="$op -fsimplify -fno-simplify-op -fno-simplify-phi -fno-simplify-label -fno-simplify-branch -fno-simplify-copy -fno-simplify-arith -fno-simplify-shift -fno-simplify-bitwise -fno-simplify-logical"
33 #op="$op -fdebug-rebuild-ssa-form"
34 op="$op -fmax-allocation-passes=8"
35 op="$op  -fdebug-live-range-conflicts"
36 op="$op -fdebug-scc-transform"
37 op="$op -fdebug-scc-transform2"
38 #-fdebug-coalescing
39 #-fdebug-coalesing2
40 #-fno-simplify-call "
41 #-fno-always-inline"
42 #
43 #op="-O2 -mmmx -msse --debug=4294967295"
44 #op="-fdebug -fdebug-triples -fdebug-inline -O2 -mmmx -msse -fno-always-inline "
45 #op="-fdebug -fdebug-inline -O2 -mmmx  "
46 #op="-fdebug -fdebug-live-range-conflicts -fdebug-live-range-conflicts2 -fno-debug-interference -fdebug-color-graph -fdebug-coalescing -fmax-allocation-passes=10 -O2 -mmmx -msse"
47 #op="-fdebug -O2 -mmmx -msse"
48 #op="-fdebug -fdebug-inline -fno-eliminate-inefectual-code -fno-always-inline -mmmx" 
49 #op="-fdebug -fdebug-inline -fno-always-inline -mmmx" 
50 export ALLOC_CHECK_=2
51 rm -f core $base.S $base.debug $base.debug2 $base.elf $base.out && 
52 make romcc && 
53 $ROMCC $op -o $base.S $base.c 2>&1 > $base.debug | tee $base.debug2 
54 if [ '(' -f $base.c ')' -a '(' '!' -f core ')' -a '(' -f $base.S ')' ]; then
55         if [ "$stem" = "linux_test$N" ] ; then
56                 as $base.S -o $base.o &&
57                 ld -T tests/ldscript.ld $base.o -o $base.elf &&
58                 ./$base.elf > $base.out &&
59                 diff -u results/$stem.out $base.out
60         else
61                 /bin/true
62         fi
63 else
64         /bin/false
65 fi
66
67