From: Chad Rosier Date: Wed, 20 Jul 2011 19:14:30 +0000 (+0000) Subject: If -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c57114ab9f8e4c2d680f43a95fe23b13f446b723;p=clang If -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple x86_64-pc-win32-macho is used in conjunction with -no-integrated-as go ahead and use the Darwin system assembler. rdar://9785470 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135604 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 1619ef8f84..8b5b2ec9b0 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1752,6 +1752,10 @@ Tool &Windows::SelectTool(const Compilation &C, const JobAction &JA, else Key = JA.getKind(); + bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as, + options::OPT_no_integrated_as, + IsIntegratedAssemblerDefault()); + Tool *&T = Tools[Key]; if (!T) { switch (Key) { @@ -1766,7 +1770,11 @@ Tool &Windows::SelectTool(const Compilation &C, const JobAction &JA, case Action::CompileJobClass: T = new tools::Clang(*this); break; case Action::AssembleJobClass: - T = new tools::ClangAs(*this); break; + if (!UseIntegratedAs && getTriple().getEnvironment() == llvm::Triple::MachO) + T = new tools::darwin::Assemble(*this); + else + T = new tools::ClangAs(*this); + break; case Action::LinkJobClass: T = new tools::visualstudio::Link(*this); break; } diff --git a/test/Driver/ccc-host-triple-no-integrated-as.c b/test/Driver/ccc-host-triple-no-integrated-as.c new file mode 100644 index 0000000000..ff0f3960fa --- /dev/null +++ b/test/Driver/ccc-host-triple-no-integrated-as.c @@ -0,0 +1,20 @@ +// Check that -no-integrated-as works when -ccc-host-triple i386-pc-win32-macho or +// -ccc-host-triple x86_64-pc-win32-macho is specified. + +// RUN: %clang -### -c -ccc-host-triple i386-pc-win32-macho -no-integrated-as %s 2> %t1 +// RUN: FileCheck -check-prefix=X86 < %t1 %s +// RUN: %clang -### -c -ccc-host-triple x86_64-pc-win32-macho -no-integrated-as %s 2> %t2 +// RUN: FileCheck -check-prefix=X86_64 < %t2 %s +// +// X86: "-cc1" +// X86-NOT: "-cc1as" +// X86: "-arch" +// X86: "i386" +// +// X86_64: "-cc1" +// X86_64-NOT: "-cc1as" +// X86_64: "-arch" +// X86_64: "x86_64" + + +