blob: af14e5e6a3353d91f893c9259fa0b89d45cfeb81 [file] [log] [blame]
Daniel Dunbarb3a69012009-06-26 16:47:03 +00001#!/bin/sh
2
3function test () {
4 arch=$1
5 file=$2
6 name=$3
7 ldflags=$4
8
9 if gcc -arch $arch -Os $file $ldflags -DLIBNAME=$name
10 then
11 if ./a.out
12 then
13 rm ./a.out
14 else
15 echo "fail"
16 fi
17 else
18 echo "$FILE failed to compile"
19 fi
20}
21
22INSTALLED=/usr/local/lib/system/libcompiler_rt.a
23
24for ARCH in i386 x86_64; do
25 for FILE in $(ls *.c); do
26
27 echo "Timing $FILE for $ARCH"
28
29 test $ARCH $FILE libgcc ""
30 test $ARCH $FILE untuned ../../Release/libcompiler_rt.Generic.a
31 test $ARCH $FILE tuned ../../Release/libcompiler_rt.Optimized.a
32 if [ -f "$INSTALLED" ]; then
33 test $ARCH $FILE installed $INSTALLED
34 fi
35
36 echo " "
37
38 done
39done
40exit