diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2012-04-08 17:30:40 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2012-04-08 17:30:40 +0200 |
commit | ed6b1f466688d22ab8c7db54b8bf245912c6b934 (patch) | |
tree | e6e3d10357e99f329e05b385694cb6361e8868ad /test.sh | |
parent | 95961190651b185e4bfcd44dc69f587be2cdfc26 (diff) | |
download | ccache-ed6b1f466688d22ab8c7db54b8bf245912c6b934.tar.gz |
test: Only run -fprofile-generate tests for compilers that support it
Diffstat (limited to 'test.sh')
-rwxr-xr-x | test.sh | 62 |
1 files changed, 32 insertions, 30 deletions
@@ -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 } |