For example, don't fall back in /P (preprocess) mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199153
91177308-0d34-0410-b5e6-
96231b3b80d8
}
// Finally add the compile command to the compilation.
- if (Args.hasArg(options::OPT__SLASH_fallback)) {
+ if (Args.hasArg(options::OPT__SLASH_fallback) &&
+ Output.getType() == types::TY_Object) {
tools::visualstudio::Compile CL(getToolChain());
Command *CLCommand = CL.GetCommand(C, JA, Output, Inputs, Args,
LinkingOutput);
// RUN: %clang_cl /fallback /Ox -### -- %s 2>&1 | FileCheck -check-prefix=Ox %s
// Ox: cl.exe
// Ox: "/Ox"
+
+// Only fall back when actually compiling, not for e.g. /P (preprocess).
+// RUN: %clang_cl /fallback /P -### -- %s 2>&1 | FileCheck -check-prefix=P %s
+// P-NOT: ||
+// P-NOT: "cl.exe"