From 2031c581a648e14d3f3eaa475df0ae3d29780180 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 17 Jul 2024 10:31:07 +0200 Subject: [PATCH] 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. --- test/suites/profiling_gcc.bash | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) 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 } -- 2.47.2