]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Remove duplicate -Xarch second argument (#981)
authorSteve Mokris <smokris@softpixel.com>
Wed, 29 Dec 2021 13:56:45 +0000 (08:56 -0500)
committerGitHub <noreply@github.com>
Wed, 29 Dec 2021 13:56:45 +0000 (14:56 +0100)
src/argprocessing.cpp
test/suites/multi_arch.bash

index 0e2898e510236a358f7ac72120bf9cc0c98fd8c2..3ab7c5eddb88e672d559e5169e3cc38af7d532b0 100644 (file)
@@ -340,7 +340,7 @@ process_arg(const Context& ctx,
       return Statistic::unsupported_compiler_option;
     }
     state.common_args.push_back(args[i]);
-    state.common_args.push_back(args[i + 1]);
+    state.common_args.push_back(args[++i]);
     return nullopt;
   }
 
index 2f5c77bb2430bd3b0bc3ad06097e738195735d68..9a705cd3ec092d7e6681c898cc37e47c33d09428 100644 (file)
@@ -37,9 +37,11 @@ SUITE_multi_arch() {
     expect_stat cache_miss 3
 
     # A single -Xarch_* matching -arch is supported.
-    $CCACHE_COMPILE -arch x86_64 -Xarch_x86_64 -I. -c test1.c
+    CCACHE_DEBUG=1 $CCACHE_COMPILE -arch x86_64 -Xarch_x86_64 -I. -c test1.c
     expect_stat direct_cache_hit 2
     expect_stat cache_miss 4
+    expect_contains     test1.o.ccache-log "clang -Xarch_x86_64 -I. -arch x86_64 -E test1.c"
+    expect_not_contains test1.o.ccache-log "clang -Xarch_x86_64 -I. -I. -arch x86_64 -E test1.c"
 
     $CCACHE_COMPILE -arch x86_64 -Xarch_x86_64 -I. -c test1.c
     expect_stat direct_cache_hit 3