summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2012-04-08 17:30:40 +0200
committerJoel Rosdahl <joel@rosdahl.net>2012-04-08 17:30:40 +0200
commited6b1f466688d22ab8c7db54b8bf245912c6b934 (patch)
treee6e3d10357e99f329e05b385694cb6361e8868ad /test.sh
parent95961190651b185e4bfcd44dc69f587be2cdfc26 (diff)
downloadccache-ed6b1f466688d22ab8c7db54b8bf245912c6b934.tar.gz
test: Only run -fprofile-generate tests for compilers that support it
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh62
1 files changed, 32 insertions, 30 deletions
diff --git a/test.sh b/test.sh
index f1ea65c4..ff9af36b 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
}