2005-05-13 Josh Conner <jconner@apple.com>
[official-gcc.git] / libstdc++-v3 / scripts / check_compile
blobe27cc33c8a0cb294a09fdc3b92d5e6c18781b664
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`
27 PCH_FLAGS=`$flags_script --cxxpchflags`
28 FLAGS=`$flags_script --cxxflags`
29 TEST_FLAGS="-S"
30 COMPILER=`$flags_script --build-cxx`
31 CXX="$COMPILER $INCLUDES $PCH_FLAGS $FLAGS $TEST_FLAGS"
33 TESTS_FILE="testsuite_files"
35 for NAME in `cat $TESTS_FILE`
37 if $RUN; then
38 echo $NAME
39 FILE_NAME="`basename $NAME`"
40 OUTPUT_NAME="`echo $FILE_NAME | sed 's/cc$/s/'`"
41 $CXX $SRC_DIR/testsuite/$NAME -o $OUTPUT_NAME
42 if [ -f $OUTPUT_NAME ]; then
43 rm $OUTPUT_NAME
45 echo ""
47 done
49 exit 0