]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: Fix -march=native test to work on hybrid CPU systems master
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 15 Dec 2025 17:19:27 +0000 (18:19 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 15 Dec 2025 17:23:25 +0000 (18:23 +0100)
On a hybrid CPU system (e.g. Intel with performance and efficient
cores), -march=native expansion can be different on different core types
and thus fail the "-march=native, no CWD in input hash" test if the
first and second compilation end up on different core types. Fix this by
just verifying that CWD doesn't appear in the expansion.

test/suites/base.bash

index e6ed77e953034e2cf9e5a8bfcf3514d2bbe7e848..76650831b6260b972bd0b05cf206542cb79092a9 100644 (file)
@@ -1705,18 +1705,8 @@ EOF
     # -------------------------------------------------------------------------
     if $COMPILER -march=native -c test1.c 2>/dev/null; then
         TEST "-march=native, no CWD in input hash"
     # -------------------------------------------------------------------------
     if $COMPILER -march=native -c test1.c 2>/dev/null; then
         TEST "-march=native, no CWD in input hash"
-        mkdir a b
-        cp test1.c a
-        cp test1.c b
-        cd a
-        $CCACHE_COMPILE -march=native -c test1.c
-        expect_stat preprocessed_cache_hit 0
-        expect_stat cache_miss 1
-        cd ../b
-        $CCACHE_COMPILE -march=native -c test1.c
-        cd ..
-        expect_stat preprocessed_cache_hit 1
-        expect_stat cache_miss 1
+        CCACHE_DEBUG=1 $CCACHE_COMPILE -march=native -c test1.c
+        expect_not_contains test1.o.*.ccache-input-text "$PWD"
     fi
 
     # -------------------------------------------------------------------------
     fi
 
     # -------------------------------------------------------------------------