From 68ff130ded7f3a64dc6761ba83b7730ad94a128d Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Wed, 8 Jan 2014 01:02:06 +0000 Subject: [PATCH] [Driver] Fix a typo in the setting of the arch name when -arch x86_64h is used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198722 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Driver.cpp | 2 +- test/Driver/darwin-ld.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index afe26dbf5c..745497f9e2 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -1879,7 +1879,7 @@ static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple, // 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/test/Driver/darwin-ld.c b/test/Driver/darwin-ld.c index a3f9a7f0cd..1675fe6bb8 100644 --- a/test/Driver/darwin-ld.c +++ b/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" -- 2.40.0