From: Joel Rosdahl Date: Wed, 17 Jul 2024 08:31:07 +0000 (+0200) Subject: test: Only run -fprofile-update=atomic test when supported by compiler X-Git-Tag: v4.11~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2031c581a648e14d3f3eaa475df0ae3d29780180;p=thirdparty%2Fccache.git test: Only run -fprofile-update=atomic test when supported by compiler This fixes an issue with the arm-linux-gnueabi GCC which doesn't support -fprofile-update=atomic. --- diff --git a/test/suites/profiling_gcc.bash b/test/suites/profiling_gcc.bash index 89f90137..d1023441 100644 --- a/test/suites/profiling_gcc.bash +++ b/test/suites/profiling_gcc.bash @@ -184,24 +184,23 @@ SUITE_profiling_gcc() { expect_stat cache_miss 2 # ------------------------------------------------------------------------- + if $COMPILER -Werror -fprofile-update=atomic -fprofile-generate -c test.c 2>/dev/null; then + TEST "-fprofile-update=atomic" - TEST "-fprofile-update=atomic" - - $CCACHE_COMPILE -fprofile-update=atomic -fprofile-generate -c test.c - expect_stat direct_cache_hit 0 - expect_stat cache_miss 1 - - $COMPILER -fprofile-generate -fprofile-update=atomic test.o -o test + $CCACHE_COMPILE -fprofile-update=atomic -fprofile-generate -c test.c + expect_stat direct_cache_hit 0 + expect_stat cache_miss 1 - ./test + $COMPILER -fprofile-generate -fprofile-update=atomic test.o -o test - $CCACHE_COMPILE -fprofile-update=atomic -fprofile-generate -c test.c - expect_stat direct_cache_hit 1 - expect_stat cache_miss 1 + ./test - $CCACHE_COMPILE -fprofile-use -c test.c - expect_stat direct_cache_hit 1 - expect_stat cache_miss 2 + $CCACHE_COMPILE -fprofile-update=atomic -fprofile-generate -c test.c + expect_stat direct_cache_hit 1 + expect_stat cache_miss 1 - # ------------------------------------------------------------------------- + $CCACHE_COMPILE -fprofile-use -c test.c + expect_stat direct_cache_hit 1 + expect_stat cache_miss 2 + fi }