From 21b2be2104a140260fe274f1eed00d91b5425de7 Mon Sep 17 00:00:00 2001 From: Steve Mokris Date: Wed, 29 Dec 2021 08:56:45 -0500 Subject: [PATCH] fix: Remove duplicate -Xarch second argument (#981) --- src/argprocessing.cpp | 2 +- test/suites/multi_arch.bash | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index 0e2898e51..3ab7c5edd 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -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; } diff --git a/test/suites/multi_arch.bash b/test/suites/multi_arch.bash index 2f5c77bb2..9a705cd3e 100644 --- a/test/suites/multi_arch.bash +++ b/test/suites/multi_arch.bash @@ -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 -- 2.47.2