ArgList *Args = ParseArgStrings(Start, End);
Host = GetHostInfo(HostTriple);
+ // FIXME: This shouldn't live inside Driver, the default tool chain
+ // is part of the compilation (it is arg dependent).
DefaultToolChain = Host->getToolChain(*Args);
// FIXME: This behavior shouldn't be here.
// When there is no explicit arch for this platform, get one from
// the host so that -Xarch_ is handled correctly.
if (!Archs.size()) {
- const char *Arch = Host->getArchName().c_str();
+ const char *Arch = DefaultToolChain->getArchName().c_str();
Archs.push_back(Arch);
}
// RUN: grep -F '5: bind-arch, "i386", {3}, object' %t &&
// RUN: grep -F '6: lipo, {4, 5}, object' %t &&
+// Arch defaulting
+// RUN: clang-driver -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s &> %t &&
+// RUN: grep -F '2: bind-arch, "i386", {1}, object' %t &&
+// RUN: clang-driver -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 &> %t &&
+// RUN: grep -F '2: bind-arch, "x86_64", {1}, object' %t &&
+// RUN: clang-driver -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s &> %t &&
+// RUN: grep -F '2: bind-arch, "x86_64", {1}, object' %t &&
+// RUN: clang-driver -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 &> %t &&
+// RUN: grep -F '2: bind-arch, "i386", {1}, object' %t &&
+
// RUN: true