From: Joel Rosdahl Date: Sun, 8 Apr 2012 15:30:40 +0000 (+0200) Subject: test: Only run -fprofile-generate tests for compilers that support it X-Git-Tag: v3.2~145 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed6b1f466688d22ab8c7db54b8bf245912c6b934;p=thirdparty%2Fccache.git test: Only run -fprofile-generate tests for compilers that support it --- diff --git a/test.sh b/test.sh index f1ea65c46..ff9af36b3 100755 --- a/test.sh +++ b/test.sh @@ -502,36 +502,38 @@ EOF $CCACHE -C > /dev/null checkstat 'files in cache' 0 - testname="profile-generate" - $CCACHE -Cz > /dev/null - $CCACHE_COMPILE -c -fprofile-generate test1.c - checkstat 'cache hit (preprocessed)' 0 - checkstat 'cache miss' 1 - checkstat 'files in cache' 1 - $CCACHE_COMPILE -c -fprofile-generate test1.c - checkstat 'cache hit (preprocessed)' 1 - checkstat 'cache miss' 1 - checkstat 'files in cache' 1 - - testname="profile-arcs" - $CCACHE_COMPILE -c -fprofile-arcs test1.c - checkstat 'cache hit (preprocessed)' 1 - checkstat 'cache miss' 2 - checkstat 'files in cache' 2 - $CCACHE_COMPILE -c -fprofile-arcs test1.c - checkstat 'cache hit (preprocessed)' 2 - checkstat 'cache miss' 2 - checkstat 'files in cache' 2 - - testname="profile-use" - $CCACHE_COMPILE -c -fprofile-use test1.c 2> /dev/null - checkstat 'cache hit (preprocessed)' 2 - checkstat 'cache miss' 3 - checkstat 'files in cache' 4 - $CCACHE_COMPILE -c -fprofile-use test1.c 2> /dev/null - checkstat 'cache hit (preprocessed)' 3 - checkstat 'cache miss' 3 - checkstat 'files in cache' 4 + if $COMPILER -c -fprofile-generate test1.c 2>/dev/null; then + testname="profile-generate" + $CCACHE -Cz > /dev/null + $CCACHE_COMPILE -c -fprofile-generate test1.c + checkstat 'cache hit (preprocessed)' 0 + checkstat 'cache miss' 1 + checkstat 'files in cache' 1 + $CCACHE_COMPILE -c -fprofile-generate test1.c + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 1 + checkstat 'files in cache' 1 + + testname="profile-arcs" + $CCACHE_COMPILE -c -fprofile-arcs test1.c + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 2 + checkstat 'files in cache' 2 + $CCACHE_COMPILE -c -fprofile-arcs test1.c + checkstat 'cache hit (preprocessed)' 2 + checkstat 'cache miss' 2 + checkstat 'files in cache' 2 + + testname="profile-use" + $CCACHE_COMPILE -c -fprofile-use test1.c 2> /dev/null + checkstat 'cache hit (preprocessed)' 2 + checkstat 'cache miss' 3 + checkstat 'files in cache' 4 + $CCACHE_COMPILE -c -fprofile-use test1.c 2> /dev/null + checkstat 'cache hit (preprocessed)' 3 + checkstat 'cache miss' 3 + checkstat 'files in cache' 4 + fi rm -f test1.c }