forked from OSchip/llvm-project
handle armeb/thumb/thumbeb consistently in gnutools::Assemble::ConstructJob
Differential Revision: http://reviews.llvm.org/D8196 llvm-svn: 232940
This commit is contained in:
parent
d4cfffccc7
commit
3205f52198
|
@ -7303,15 +7303,20 @@ void gnutools::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue