Eric Biederman | 9008960 | 2004-05-28 14:11:54 +0000 | [diff] [blame] | 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 " |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 24 | #op="$op -O2 " |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 25 | #op="$op -mmmx -msse" |
Eric Biederman | 9008960 | 2004-05-28 14:11:54 +0000 | [diff] [blame] | 26 | op="$op -finline-policy=defaulton" |
| 27 | #op="$op -finline-policy=nopenalty" |
| 28 | #op="$op -finline-policy=never" |
| 29 | op="$op -fdebug -fdebug-triples -fdebug-interference -fdebug-verification" |
Yinghai Lu | 13f1c2a | 2005-07-08 02:49:49 +0000 | [diff] [blame] | 30 | op="$op -fdebug-fdominators" |
| 31 | op="$op -fdebug-inline" |
| 32 | op="$op -fdebug-calls" |
Eric Biederman | 9008960 | 2004-05-28 14:11:54 +0000 | [diff] [blame] | 33 | #op="$op -mnoop-copy" |
| 34 | #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" |
| 35 | #op="$op -fdebug-rebuild-ssa-form" |
| 36 | op="$op -fmax-allocation-passes=8" |
| 37 | op="$op -fdebug-live-range-conflicts" |
| 38 | op="$op -fdebug-scc-transform" |
| 39 | op="$op -fdebug-scc-transform2" |
| 40 | #-fdebug-coalescing |
| 41 | #-fdebug-coalesing2 |
| 42 | #-fno-simplify-call " |
| 43 | #-fno-always-inline" |
| 44 | # |
| 45 | #op="-O2 -mmmx -msse --debug=4294967295" |
| 46 | #op="-fdebug -fdebug-triples -fdebug-inline -O2 -mmmx -msse -fno-always-inline " |
| 47 | #op="-fdebug -fdebug-inline -O2 -mmmx " |
| 48 | #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" |
| 49 | #op="-fdebug -O2 -mmmx -msse" |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 50 | #op="-fdebug -fdebug-inline -fno-eliminate-inefectual-code -fno-always-inline -mmmx" |
| 51 | #op="-fdebug -fdebug-inline -fno-always-inline -mmmx" |
Eric Biederman | 9008960 | 2004-05-28 14:11:54 +0000 | [diff] [blame] | 52 | export ALLOC_CHECK_=2 |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 53 | rm -f core $base.S $base.debug $base.debug2 $base.elf $base.out && |
| 54 | make romcc && |
| 55 | $ROMCC $op -o $base.S $base.c 2>&1 > $base.debug | tee $base.debug2 |
Eric Biederman | 9008960 | 2004-05-28 14:11:54 +0000 | [diff] [blame] | 56 | if [ '(' -f $base.c ')' -a '(' '!' -f core ')' -a '(' -f $base.S ')' ]; then |
| 57 | if [ "$stem" = "linux_test$N" ] ; then |
| 58 | as $base.S -o $base.o && |
| 59 | ld -T tests/ldscript.ld $base.o -o $base.elf && |
| 60 | ./$base.elf > $base.out && |
| 61 | diff -u results/$stem.out $base.out |
| 62 | else |
| 63 | /bin/true |
| 64 | fi |
| 65 | else |
| 66 | /bin/false |
| 67 | fi |