6 if test "$1" != "--recursive-hack"; then
7 "$0" --recursive-hack "$@"
13 ECC_CFLAGS="${ADDCFLAGS} -O3 -c -D__builtin_memcpy=memcpy -D__builtin_memset=memset -D__builtin_strlen=strlen -D__builtin_strcpy=strcpy -D__builtin_strcmp=strcmp -DNO_TRAMPOLINES"
15 GCC_CFLAGS="-O0 -Itcc"
21 OUTPUTDIR="stats-`date +%y.%m.%d`"
27 XMLRES=$OUTPUTDIR/result.xml
28 cat > $XMLRES << __END__
32 <ECC_CFLAGS>${ECC_CFLAGS}</ECC_CFLAGS>
33 <GCC_CFLAGS>${GCC_CFLAGS}</GCC_CFLAGS>
37 # so endless apps stop at some point...
42 DIRS=". langshootout ack gcc-testsuite gcc-testsuite/ieee"
43 test -n "$1" && DIRS="$1"
47 echo "<section name=\"$curdir/\">" >> $XMLRES
48 for file in $curdir/$CFILES; do
53 FIRM_RUN_RES="omitted"
56 name="`basename $file .c`"
57 res="$OUTPUTDIR/buildresult_$name.txt"
59 echo "Results for $name" > $res
60 echo "*** ECC/FIRM Compile" >> $res
61 CMD="ulimit -t${TIMEOUT_COMPILE} ; ${ECC} ${ECC_CFLAGS} $file"
63 /bin/bash -c "ulimit -t${TIMEOUT_COMPILE} ; ${ECC} ${ECC_CFLAGS} $file" >> $res 2>&1 || COMPILE_RES="failed"
65 if [ ${COMPILE_RES} == "ok" ]; then
67 CMD="mv $curdir/$name.s build_firm/$name.s"
70 echo "*** Linking" >> $res
71 CMD="${ECC} build_firm/$name.s ${LINKFLAGS} -o build_firm/$name.exe"
73 $CMD >> $res 2>&1 || LINK_RES="failed"
76 echo "*** GCC Compile" >> $res
77 CMD="${GCC} ${GCC_CFLAGS} $file ${LINKFLAGS} -o build_gcc/$name.exe"
79 $CMD >> $res 2>&1 || GCC_RES="failed"
81 if [ ${GCC_RES} = "ok" ]; then
84 echo "*** Run GCC" >> $res
85 CMD="ulimit -t${TIMEOUT_RUN} ; build_gcc/$name.exe > $OUTPUTDIR/result_gcc_$name.txt 2>&1"
87 /bin/bash -c "ulimit -t${TIMEOUT_RUN} ; build_gcc/$name.exe" > $OUTPUTDIR/result_gcc_$name.txt 2>&1 || GCC_RUN_RES="failed"
90 if [ ${LINK_RES} = "ok" ]; then
93 echo "*** Run Firm" >> $res
94 CMD="ulimit -t${TIMEOUT_RUN} ; build_firm/$name.exe > $OUTPUTDIR/result_gcc_$name.txt 2>&1"
96 /bin/bash -c "ulimit -t${TIMEOUT_RUN} ; build_firm/$name.exe" > $OUTPUTDIR/result_firm_$name.txt 2>&1 || FIRM_RUN_RES="failed"
99 if [ ${GCC_RUN_RES} = "ok" -a ${FIRM_RUN_RES} = "ok" ]; then
102 echo "*** Compare Results" >> $res
103 CMD="diff -u $OUTPUTDIR/result_gcc_$name.txt $OUTPUTDIR/result_firm_$name.txt"
104 $CMD > $OUTPUTDIR/result_diff_$name.txt 2>&1 || DIFF_RES="failed"
107 cat >> $XMLRES << __END__
108 <result name="$name">
109 <compile>$COMPILE_RES</compile>
110 <link>$LINK_RES</link>
111 <gcc_compile>$GCC_RES</gcc_compile>
112 <gcc_run>$GCC_RUN_RES</gcc_run>
113 <firm_run>$FIRM_RUN_RES</firm_run>
114 <diff>$DIFF_RES</diff>
118 echo "</section>" >> $XMLRES
121 echo "</results>" >> $XMLRES
123 xsltproc --output $OUTPUTDIR/index.html makehtml.xslt $XMLRES
125 # maybe execute custom actions after result has been generated
126 [ -e after_compile.sh ] && ./after_compile.sh "$OUTPUTDIR"