r198911 - Pass -32/-64 to the assembler when building for sparc/sparc64.
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Jan 9 19:51:30 PST 2014
Author: stoklund
Date: Thu Jan 9 21:51:29 2014
New Revision: 198911
URL: http://llvm.org/viewvc/llvm-project?rev=198911&view=rev
Log:
Pass -32/-64 to the assembler when building for sparc/sparc64.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/linux-as.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=198911&r1=198910&r2=198911&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Jan 9 21:51:29 2014
@@ -6289,6 +6289,10 @@ void gnutools::Assemble::ConstructJob(Co
CmdArgs.push_back("-a64");
CmdArgs.push_back("-mppc64le");
CmdArgs.push_back("-many");
+ } else if (getToolChain().getArch() == llvm::Triple::sparc) {
+ CmdArgs.push_back("-32");
+ } else if (getToolChain().getArch() == llvm::Triple::sparcv9) {
+ CmdArgs.push_back("-64");
} else if (getToolChain().getArch() == llvm::Triple::arm) {
StringRef MArch = getToolChain().getArchName();
if (MArch == "armv7" || MArch == "armv7a" || MArch == "armv7-a")
Modified: cfe/trunk/test/Driver/linux-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-as.c?rev=198911&r1=198910&r2=198911&view=diff
==============================================================================
--- cfe/trunk/test/Driver/linux-as.c (original)
+++ cfe/trunk/test/Driver/linux-as.c Thu Jan 9 21:51:29 2014
@@ -60,6 +60,20 @@
// RUN: | FileCheck -check-prefix=CHECK-PPC-NO-MCPU %s
// CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu"
//
+// RUN: %clang -target sparc64-linux -mcpu=invalid-cpu -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-SPARCV9 %s
+// CHECK-SPARCV9: as
+// CHECK-SPARCV9: -64
+// CHECK-SPARCV9: -o
+//
+// RUN: %clang -target sparc-linux -mcpu=invalid-cpu -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-SPARCV8 %s
+// CHECK-SPARCV8: as
+// CHECK-SPARCV8: -32
+// CHECK-SPARCV8: -o
+//
// RUN: %clang -target s390x-linux -### -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-Z-DEFAULT-ARCH %s
// CHECK-Z-DEFAULT-ARCH: as{{.*}} "-march=z10"
More information about the cfe-commits
mailing list