Home | History | Annotate | Line # | Download | only in timing
      1  1.1  joerg #!/bin/sh
      2  1.1  joerg 
      3  1.1  joerg function test () {
      4  1.1  joerg     arch=$1
      5  1.1  joerg     file=$2
      6  1.1  joerg     name=$3
      7  1.1  joerg     ldflags=$4
      8  1.1  joerg 
      9  1.1  joerg     if gcc -arch $arch -Os $file $ldflags -DLIBNAME=$name
     10  1.1  joerg     then
     11  1.1  joerg 	if ./a.out
     12  1.1  joerg 	then
     13  1.1  joerg 	    rm ./a.out
     14  1.1  joerg 	else
     15  1.1  joerg 	    echo "fail"
     16  1.1  joerg 	fi
     17  1.1  joerg     else
     18  1.1  joerg 	echo "$FILE failed to compile"
     19  1.1  joerg     fi
     20  1.1  joerg }
     21  1.1  joerg 
     22  1.1  joerg INSTALLED=/usr/local/lib/system/libcompiler_rt.a
     23  1.1  joerg 
     24  1.1  joerg for ARCH in i386 x86_64; do
     25  1.1  joerg 	for FILE in $(ls *.c); do
     26  1.1  joerg 		
     27  1.1  joerg 		echo "Timing $FILE for $ARCH"
     28  1.1  joerg 
     29  1.1  joerg 		test $ARCH $FILE libgcc ""
     30  1.1  joerg                 test $ARCH $FILE tuned ../../darwin_fat/Release/libcompiler_rt.a
     31  1.1  joerg                 if [ -f "$INSTALLED" ]; then
     32  1.1  joerg                     test $ARCH $FILE installed $INSTALLED
     33  1.1  joerg 		fi
     34  1.1  joerg 
     35  1.1  joerg 		echo " "
     36  1.1  joerg 		
     37  1.1  joerg 	done
     38  1.1  joerg done
     39  1.1  joerg exit
     40