[cfe-commits] r68019 - in /cfe/trunk: lib/Driver/ToolChains.cpp lib/Driver/Tools.cpp test/Driver/darwin-cc.c
Daniel Dunbar
daniel at zuster.org
Sun Mar 29 15:27:40 PDT 2009
Author: ddunbar
Date: Sun Mar 29 17:27:40 2009
New Revision: 68019
URL: http://llvm.org/viewvc/llvm-project?rev=68019&view=rev
Log:
Driver: Add test case for darwin::Preprocess and darwin::Compile
tools, and enable them.
Added:
cfe/trunk/test/Driver/darwin-cc.c
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=68019&r1=68018&r2=68019&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sun Mar 29 17:27:40 2009
@@ -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:
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=68019&r1=68018&r2=68019&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sun Mar 29 17:27:40 2009
@@ -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 =
Added: cfe/trunk/test/Driver/darwin-cc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-cc.c?rev=68019&view=auto
==============================================================================
--- cfe/trunk/test/Driver/darwin-cc.c (added)
+++ cfe/trunk/test/Driver/darwin-cc.c Sun Mar 29 17:27:40 2009
@@ -0,0 +1,6 @@
+// RUN: clang -ccc-no-clang -ccc-host-triple i386-apple-darwin10 -m32 -### -MD -g -fast -Q -dA -mkernel -ansi -aFOO -S -o /tmp/OUTPUTNAME -g0 -gfull -O2 -Werror -pedantic -Wmost -w -std=c99 -trigraphs -v -pg -fFOO -undef -Qn --param a=b -fmudflap -coverage -save-temps -nostdinc -I ARG0 -F ARG1 -I ARG2 -P -MF ARG3 -MG -MP -remap -g3 -H -D ARG4 -U ARG5 -A ARG6 -D ARG7 -U ARG8 -A ARG9 -include ARG10 -pthread %s 2> %t.log &&
+// RUN: grep ' ".*cc1" "-E" "-nostdinc" "-v" "-I" "ARG0" "-F" "ARG1" "-I" "ARG2" "-P" "-MD" "/tmp/OUTPUTNAME.d" "-MF" "ARG3" "-MG" "-MP" "-MQ" "/tmp/OUTPUTNAME" "-remap" "-dD" "-H" "-D__STATIC__" "-D_REENTRANT" "-D" "ARG4" "-U" "ARG5" "-A" "ARG6" "-D" "ARG7" "-U" "ARG8" "-A" "ARG9" "-include" "ARG10" ".*darwin-cc.c" "-D_MUDFLAP" "-include" "mf-runtime.h" "-mmacosx-version-min=10.6.0" "-m32" "-mkernel" "-mtune=core2" "-ansi" "-std=c99" "-trigraphs" "-Werror" "-pedantic" "-Wmost" "-w" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-O2" "-undef" "-fpch-preprocess" "-o" ".*darwin-cc.i"' %t.log &&
+// RUN: grep ' ".*cc1" "-fpreprocessed" ".*darwin-cc.i" "-O3" "-dumpbase" ".*darwin-cc.c" "-dA" "-mmacosx-version-min=10.6.0" "-m32" "-mkernel" "-mtune=core2" "-ansi" "-aFOO" "-auxbase-strip" "/tmp/OUTPUTNAME" "-g" "-g0" "-g" "-g3" "-O2" "-Werror" "-pedantic" "-Wmost" "-w" "-ansi" "-std=c99" "-trigraphs" "-version" "-p" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-undef" "-fno-ident" "-o" "/tmp/OUTPUTNAME" "--param" "a=b" "-fno-builtin" "-fno-merge-constants" "-fprofile-arcs" "-ftest-coverage"' %t.log &&
+
+// RUN: true
+
More information about the cfe-commits
mailing list