]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix test errors with GCC 4.4
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 2 Sep 2020 08:53:45 +0000 (10:53 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 2 Sep 2020 08:53:45 +0000 (10:53 +0200)
test/suites/direct.bash
test/suites/profiling.bash
test/suites/profiling_gcc.bash

index e766af5a83415e15799e0b78e439e8959177e83b..d06e80860dcadc3798b22afb7bf5dcb9a2d6f47b 100644 (file)
@@ -361,7 +361,7 @@ EOF
 int test() { return 0; }
 EOF
 
-    if $COMPILER_TYPE_GCC; then
+    if $COMPILER -c -fstack-usage code.c >/dev/null 2>&1; then
         $CCACHE_COMPILE -c -fstack-usage code.c
         expect_stat 'cache hit (direct)' 0
         expect_stat 'cache hit (preprocessed)' 0
index 553f908658506f9846373698dc04390a7b08778b..babc478881a5b5361140d1dca264084534ad646d 100644 (file)
@@ -74,7 +74,7 @@ SUITE_profiling() {
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache miss' 1
 
-    $COMPILER -fprofile-generate=data test.o -o test
+    $COMPILER -fprofile-generate=data test.o -lgcov -o test
 
     ./test
     merge_profiling_data data
index fe61109ed9cc306cf6553513f3079b309bc1438a..8142122898738b6c32b091ec4e5fae5eb84a5ce3 100644 (file)
@@ -17,21 +17,21 @@ SUITE_profiling_gcc() {
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache miss' 1
 
-    $COMPILER -fprofile-generate test.o -o test
+    $COMPILER -fprofile-generate test.o -lgcov -o test
 
     ./test
 
-    $CCACHE_COMPILE -fbranch-probabilities -c test.c
+    $CCACHE_COMPILE -fbranch-probabilities -c test.c 2>/dev/null
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache miss' 2
 
-    $CCACHE_COMPILE -fbranch-probabilities -c test.c
+    $CCACHE_COMPILE -fbranch-probabilities -c test.c 2>/dev/null
     expect_stat 'cache hit (direct)' 1
     expect_stat 'cache miss' 2
 
     ./test
 
-    $CCACHE_COMPILE -fbranch-probabilities -c test.c
+    $CCACHE_COMPILE -fbranch-probabilities -c test.c 2>/dev/null
     expect_stat 'cache hit (direct)' 1
     expect_stat 'cache miss' 3
 
@@ -44,7 +44,7 @@ SUITE_profiling_gcc() {
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache miss' 1
 
-    $COMPILER -fprofile-dir=data -fprofile-generate test.o -o test
+    $COMPILER -fprofile-dir=data -fprofile-generate test.o -lgcov -o test
 
     ./test
 
@@ -71,7 +71,7 @@ SUITE_profiling_gcc() {
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache miss' 1
 
-    $COMPILER -fprofile-generate -fprofile-dir=data test.o -o test
+    $COMPILER -fprofile-generate -fprofile-dir=data test.o -lgcov -o test
 
     ./test
 
@@ -98,7 +98,7 @@ SUITE_profiling_gcc() {
     expect_stat 'cache hit (direct)' 0
     expect_stat 'cache miss' 1
 
-    $COMPILER -fprofile-dir=data2 -fprofile-generate=data test.o -o test
+    $COMPILER -fprofile-dir=data2 -fprofile-generate=data test.o -lgcov -o test
 
     ./test