r232940 - handle armeb/thumb/thumbeb consistently in gnutools::Assemble::ConstructJob
Scott Douglass
sdouglass at arm.com
Mon Mar 23 03:54:25 PDT 2015
Author: scott-0
Date: Mon Mar 23 05:54:24 2015
New Revision: 232940
URL: http://llvm.org/viewvc/llvm-project?rev=232940&view=rev
Log:
handle armeb/thumb/thumbeb consistently in gnutools::Assemble::ConstructJob
Differential Revision: http://reviews.llvm.org/D8196
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=232940&r1=232939&r2=232940&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Mar 23 05:54:24 2015
@@ -7303,15 +7303,20 @@ void gnutools::Assemble::ConstructJob(Co
case llvm::Triple::armeb:
case llvm::Triple::thumb:
case llvm::Triple::thumbeb: {
- StringRef MArch = getToolChain().getArchName();
- if (MArch == "armv7" || MArch == "armv7a" || MArch == "armv7-a")
+ const llvm::Triple &Triple = getToolChain().getTriple();
+ switch (Triple.getSubArch()) {
+ case llvm::Triple::ARMSubArch_v7:
CmdArgs.push_back("-mfpu=neon");
- if (MArch == "armv8" || MArch == "armv8a" || MArch == "armv8-a" ||
- MArch == "armebv8" || MArch == "armebv8a" || MArch == "armebv8-a")
+ break;
+ case llvm::Triple::ARMSubArch_v8:
CmdArgs.push_back("-mfpu=crypto-neon-fp-armv8");
+ break;
+ default:
+ break;
+ }
StringRef ARMFloatABI = tools::arm::getARMFloatABI(
- getToolChain().getDriver(), Args, getToolChain().getTriple());
+ getToolChain().getDriver(), Args, Triple);
CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=" + ARMFloatABI));
Args.AddLastArg(CmdArgs, options::OPT_march_EQ);
Modified: cfe/trunk/test/Driver/linux-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-as.c?rev=232940&r1=232939&r2=232940&view=diff
==============================================================================
--- cfe/trunk/test/Driver/linux-as.c (original)
+++ cfe/trunk/test/Driver/linux-as.c Mon Mar 23 05:54:24 2015
@@ -25,16 +25,61 @@
// RUN: | FileCheck -check-prefix=CHECK-ARM-ALL %s
// CHECK-ARM-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-a" "-mcpu=cortex-a8" "-mfpu=neon"
//
+// RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon -march=armebv7-a -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-ARMEB-ALL %s
+// CHECK-ARMEB-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armebv7-a" "-mcpu=cortex-a8" "-mfpu=neon"
+//
+// RUN: %clang -target thumb-linux -mcpu=cortex-a8 -mfpu=neon -march=thumbv7-a -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-THUMB-ALL %s
+// CHECK-THUMB-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=thumbv7-a" "-mcpu=cortex-a8" "-mfpu=neon"
+//
+// RUN: %clang -target thumb-linux -mcpu=cortex-a8 -mfpu=neon -march=thumbebv7-a -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-THUMBEB-ALL %s
+// CHECK-THUMBEB-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=thumbebv7-a" "-mcpu=cortex-a8" "-mfpu=neon"
+//
// RUN: %clang -target armv7-linux -mcpu=cortex-a8 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ARM-TARGET %s
// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8"
//
+// RUN: %clang -target armebv7-linux -mcpu=cortex-a8 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-ARMEB-TARGET %s
+// CHECK-ARMEB-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8"
+//
+// RUN: %clang -target thumbv7-linux -mcpu=cortex-a8 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-THUMB-TARGET %s
+// CHECK-THUMB-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8"
+//
+// RUN: %clang -target thumbebv7-linux -mcpu=cortex-a8 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-THUMBEB-TARGET %s
+// CHECK-THUMBEB-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8"
+//
// RUN: %clang -target armv8-linux -mcpu=cortex-a53 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ARM-TARGET-V8 %s
// CHECK-ARM-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53"
//
+// RUN: %clang -target armebv8-linux -mcpu=cortex-a53 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-ARMEB-TARGET-V8 %s
+// CHECK-ARMEB-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53"
+//
+// RUN: %clang -target thumbv8-linux -mcpu=cortex-a53 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-THUMB-TARGET-V8 %s
+// CHECK-THUMB-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53"
+//
+// RUN: %clang -target thumbebv8-linux -mcpu=cortex-a53 -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-THUMBEB-TARGET-V8 %s
+// CHECK-THUMBEB-TARGET-V8: as{{(.exe)?}}" "-mfpu=crypto-neon-fp-armv8" "-mfloat-abi=soft" "-mcpu=cortex-a53"
+//
// RUN: %clang -target arm-linux -mfloat-abi=hard -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ARM-MFLOAT-ABI %s
More information about the cfe-commits
mailing list