* array.c: Don't include assert.h.
[official-gcc.git] / libstdc++-v3 / scripts / check_performance
blob090dae87ff69d1c76f4cba46e084dc7b88a8693a
1 #!/usr/bin/env bash
3 # Script to do performance testing.
5 # Invocation
6 # check_performance SRC_DIR BUILD_DIR
8 # 1: variables
10 SRC_DIR=$1
11 BUILD_DIR=$2
13 # Now that we've successfully translated the numerical option into
14 # a symbolic one, we can safely ignore it.
15 shift
17 # This has been true all along. Found out about it the hard way...
18 case $BASH_VERSION in
19 1*)
20 echo 'You need bash 2.x to run check_performance. Exiting.';
21 exit 1 ;;
22 *) ;;
23 esac
25 flags_script=$BUILD_DIR/scripts/testsuite_flags
26 INCLUDES="`$flags_script --build-includes` -include bits/stdc++.h"
27 FLAGS=`$flags_script --cxxflags`
28 THREAD_FLAG='-pthread'
29 COMPILER=`$flags_script --build-cxx`
30 SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc \
31 -Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
32 ST_FLAG="-static"
33 LINK=$SH_FLAG
34 CXX="$COMPILER $INCLUDES $FLAGS -DNOTHREAD $LINK"
35 CXX_THREAD="$COMPILER $INCLUDES $FLAGS $THREAD_FLAG $LINK"
38 TESTS_FILE="testsuite_files_performance"
40 for NAME in `cat $TESTS_FILE`
42 RUN=true
43 for CYCLE in `sed -n 's,.*\(TEST_[SB][0-9]*\)$,\1,p' $SRC_DIR/testsuite/$NAME`
45 RUN=false
46 echo $NAME $CYCLE
47 FILE_NAME="`basename $NAME`"
48 EXE_NAME="`echo $FILE_NAME-$CYCLE | sed 's/cc$/exe/'`"
49 $CXX -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
50 ./$EXE_NAME
51 echo ""
52 done
53 for CYCLE in `sed -n 's,.*\(TEST_[TB][0-9]*\)$,\1,p' $SRC_DIR/testsuite/$NAME`
55 RUN=false
56 echo $NAME $CYCLE THREAD
57 FILE_NAME="`basename $NAME`"
58 EXE_NAME="`echo $FILE_NAME-$CYCLE | sed 's/cc$/exe/'`"
59 $CXX_THREAD -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
60 ./$EXE_NAME
61 echo ""
62 done
63 if $RUN; then
64 echo $NAME
65 FILE_NAME="`basename $NAME`"
66 EXE_NAME="`echo $FILE_NAME | sed 's/cc$/exe/'`"
67 $CXX $SRC_DIR/testsuite/$NAME -o $EXE_NAME
68 ./$EXE_NAME
69 echo ""
71 done
73 exit 0