summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Driver/Tools.cpp5
-rw-r--r--clang/test/Driver/no-integrated-as-win.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 7f22d6ff091..f88c2068408 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -225,7 +225,10 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args,
}
static bool forwardToGCC(const Option &O) {
- return !O.hasFlag(options::NoForward) &&
+ // Don't forward inputs from the original command line. They are added from
+ // InputInfoList.
+ return !O.getKind() == Option::InputClass &&
+ !O.hasFlag(options::NoForward) &&
!O.hasFlag(options::DriverOption) &&
!O.hasFlag(options::LinkerInput);
}
diff --git a/clang/test/Driver/no-integrated-as-win.c b/clang/test/Driver/no-integrated-as-win.c
index 0d6c2958e57..1ab2480c5d3 100644
--- a/clang/test/Driver/no-integrated-as-win.c
+++ b/clang/test/Driver/no-integrated-as-win.c
@@ -1,3 +1,11 @@
// RUN: %clang -target x86_64-pc-win32 -### -no-integrated-as %s -c 2>&1 | FileCheck %s
-
// CHECK: there is no external assembler we can use on windows
+
+// But there is for mingw. The source file should only be mentioned once for
+// the compile step.
+// RUN: %clang -target i686-pc-mingw32 -### -no-integrated-as %s -c 2>&1 | FileCheck -check-prefix=MINGW %s
+// MINGW: "-cc1"
+// MINGW: "-main-file-name" "no-integrated-as-win.c"
+// MINGW: "-x" "c" "{{.*}}no-integrated-as-win.c"
+// The assembler goes here, but its name depends on PATH.
+// MINGW-NOT: no-integrated-as-win.c
OpenPOWER on IntegriCloud