blob: 846c1d02b7ab0759c84a5c9b190051d53ed35f3a [file] [log] [blame]
Eric Biederman90089602004-05-28 14:11:54 +00001#!/bin/sh
2# Allow core dumps
3ulimit -c hard
4set -x
5N=''
6root=simple_test
7#root=simple_test
8#root=linux_test
9#root=raminit_test
10if [ -n "$2" -a -n "$1" ] ; then
11 root=$1
12 N=$2
13elif [ -n "$1" ] ; then
14 root=$1
15else
16 echo "too few arguments"
17 exit 1
18fi
19ROMCC=./romcc
20stem="$root$N"
21base=tests/$stem
22op="-Itests/include"
23op="$op -feliminate-inefectual-code -fsimplify -fscc-transform "
Stefan Reinauer14e22772010-04-27 06:56:47 +000024#op="$op -O2 "
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000025#op="$op -mmmx -msse"
Eric Biederman90089602004-05-28 14:11:54 +000026op="$op -finline-policy=defaulton"
27#op="$op -finline-policy=nopenalty"
28#op="$op -finline-policy=never"
29op="$op -fdebug -fdebug-triples -fdebug-interference -fdebug-verification"
Yinghai Lu13f1c2a2005-07-08 02:49:49 +000030op="$op -fdebug-fdominators"
31op="$op -fdebug-inline"
32op="$op -fdebug-calls"
Eric Biederman90089602004-05-28 14:11:54 +000033#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"
36op="$op -fmax-allocation-passes=8"
37op="$op -fdebug-live-range-conflicts"
38op="$op -fdebug-scc-transform"
39op="$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 Reinauer14e22772010-04-27 06:56:47 +000050#op="-fdebug -fdebug-inline -fno-eliminate-inefectual-code -fno-always-inline -mmmx"
51#op="-fdebug -fdebug-inline -fno-always-inline -mmmx"
Eric Biederman90089602004-05-28 14:11:54 +000052export ALLOC_CHECK_=2
Stefan Reinauer14e22772010-04-27 06:56:47 +000053rm -f core $base.S $base.debug $base.debug2 $base.elf $base.out &&
54make romcc &&
55$ROMCC $op -o $base.S $base.c 2>&1 > $base.debug | tee $base.debug2
Eric Biederman90089602004-05-28 14:11:54 +000056if [ '(' -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
65else
66 /bin/false
67fi