[Driver] Fix a typo in the setting of the arch name when -arch x86_64h is used.
<rdar://problem/15711488>

llvm-svn: 198722
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index afe26db..745497f 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1879,7 +1879,7 @@
     // Handle the Darwin '-arch' flag.
     if (Arg *A = Args.getLastArg(options::OPT_arch)) {
       if (StringRef(A->getValue()) == "x86_64h")
-        Target.setArchName(DarwinArchName);
+        Target.setArchName(A->getValue());
       else {
         llvm::Triple::ArchType DarwinArch
           = tools::darwin::getArchTypeForDarwinArchName(A->getValue());
diff --git a/clang/test/Driver/darwin-ld.c b/clang/test/Driver/darwin-ld.c
index a3f9a7f..1675fe6 100644
--- a/clang/test/Driver/darwin-ld.c
+++ b/clang/test/Driver/darwin-ld.c
@@ -148,3 +148,12 @@
 //
 // LINK_X86_64H_ARCH: {{ld(.exe)?"}}
 // LINK_X86_64H_ARCH: "x86_64h"
+
+// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -arch x86_64h -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=LINK_X86_64H_MULTIARCH %s < %t.log
+//
+// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}}
+// LINK_X86_64H_MULTIARCH: "x86_64"
+//
+// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}}
+// LINK_X86_64H_MULTIARCH: "x86_64h"