From 3f77bbd2654297900fa15b2d09811c67542893c8 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 2 Sep 2020 10:53:45 +0200 Subject: [PATCH] Fix test errors with GCC 4.4 --- test/suites/direct.bash | 2 +- test/suites/profiling.bash | 2 +- test/suites/profiling_gcc.bash | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/suites/direct.bash b/test/suites/direct.bash index e766af5a8..d06e80860 100644 --- a/test/suites/direct.bash +++ b/test/suites/direct.bash @@ -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 diff --git a/test/suites/profiling.bash b/test/suites/profiling.bash index 553f90865..babc47888 100644 --- a/test/suites/profiling.bash +++ b/test/suites/profiling.bash @@ -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 diff --git a/test/suites/profiling_gcc.bash b/test/suites/profiling_gcc.bash index fe61109ed..814212289 100644 --- a/test/suites/profiling_gcc.bash +++ b/test/suites/profiling_gcc.bash @@ -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 -- 2.47.2