Driver: Add test case for darwin::Preprocess and darwin::Compile
tools, and enable them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68019 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 1b0bdfa..8bbf2a6 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -111,13 +111,12 @@
case Action::BindArchClass:
assert(0 && "Invalid tool kind.");
case Action::PreprocessJobClass:
- T = new tools::gcc::Preprocess(*this); break;
- case Action::PrecompileJobClass:
- T = new tools::gcc::Precompile(*this); break;
+ T = new tools::darwin::Preprocess(*this); break;
case Action::AnalyzeJobClass:
T = new tools::Clang(*this); break;
+ case Action::PrecompileJobClass:
case Action::CompileJobClass:
- T = new tools::gcc::Compile(*this); break;
+ T = new tools::darwin::Compile(*this); break;
case Action::AssembleJobClass:
T = new tools::darwin::Assemble(*this); break;
case Action::LinkJobClass:
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 0471f2d..2f7c464 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -787,9 +787,12 @@
assert(Output.isPipe() && "Unexpected CC1 output.");
}
- AddCPPOptionsArgs(Args, CmdArgs, Inputs, OutputArgs);
-
- Args.AddAllArgs(CmdArgs, options::OPT_d_Group);
+ if (Args.hasArg(options::OPT_E)) {
+ AddCPPOptionsArgs(Args, CmdArgs, Inputs, OutputArgs);
+ } else {
+ AddCPPOptionsArgs(Args, CmdArgs, Inputs, ArgStringList());
+ CmdArgs.append(OutputArgs.begin(), OutputArgs.end());
+ }
const char *CC1Name = getCC1Name(Inputs[0].getType());
const char *Exec =