From: Evgeniy Stepanov Date: Fri, 20 Apr 2012 09:03:40 +0000 (+0000) Subject: Pass -mfloat-abi= to linuxtools assembler. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=700c508fd469a971480c36d54ae12fe9011f27c0;p=clang Pass -mfloat-abi= to linuxtools assembler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155191 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 47b5294954..57c0645635 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -5064,6 +5064,10 @@ void linuxtools::Assemble::ConstructJob(Compilation &C, const JobAction &JA, StringRef MArch = getToolChain().getArchName(); if (MArch == "armv7" || MArch == "armv7a" || MArch == "armv7-a") CmdArgs.push_back("-mfpu=neon"); + + StringRef ARMFloatABI = getARMFloatABI(getToolChain().getDriver(), Args, + getToolChain().getTriple()); + CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=" + ARMFloatABI)); } else if (getToolChain().getArch() == llvm::Triple::mips || getToolChain().getArch() == llvm::Triple::mipsel || getToolChain().getArch() == llvm::Triple::mips64 || diff --git a/test/Driver/linux-as.c b/test/Driver/linux-as.c index 22eac0d2dd..8c14993a40 100644 --- a/test/Driver/linux-as.c +++ b/test/Driver/linux-as.c @@ -3,29 +3,49 @@ // RUN: %clang -target arm-linux -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=ARM %s -// CHECK-ARM: as{{(.exe)?}}" +// CHECK-ARM: as{{(.exe)?}}" "-mfloat-abi=soft" // // RUN: %clang -target arm-linux -mcpu=cortex-a8 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-MCPU %s -// CHECK-ARM-MCPU: as{{(.exe)?}}" "-mcpu=cortex-a8" +// CHECK-ARM-MCPU: as{{(.exe)?}}" "-mfloat-abi=soft" "-mcpu=cortex-a8" // // RUN: %clang -target arm-linux -mfpu=neon -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-MFPU %s -// CHECK-ARM-MFPU: as{{(.exe)?}}" "-mfpu=neon" +// CHECK-ARM-MFPU: as{{(.exe)?}}" "-mfloat-abi=soft" "-mfpu=neon" // // RUN: %clang -target arm-linux -march=armv7-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-MARCH %s -// CHECK-ARM-MARCH: as{{(.exe)?}}" "-march=armv7-a" +// CHECK-ARM-MARCH: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-a" // // RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon -march=armv7-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-ALL %s -// CHECK-ARM-ALL: as{{(.exe)?}}" "-march=armv7-a" "-mcpu=cortex-a8" "-mfpu=neon" +// CHECK-ARM-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-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=ARM-TARGET %s -// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mcpu=cortex-a8" +// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8" +// +// RUN: %clang -target arm-linux -mfloat-abi=hard -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-MFLOAT-ABI %s +// CHECK-ARM-MFLOAT-ABI: as{{(.exe)?}}" "-mfloat-abi=hard" +// +// RUN: %clang -target arm-linux-androideabi -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-ANDROID %s +// CHECK-ARM-ANDROID: as{{(.exe)?}}" "-mfloat-abi=soft" +// +// RUN: %clang -target arm-linux-androideabi -march=armv7-a -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-ANDROID-SOFTFP %s +// CHECK-ARM-ANDROID-SOFTFP: as{{(.exe)?}}" "-mfloat-abi=softfp" "-march=armv7-a" +// +// RUN: %clang -target arm-linux-eabi -mhard-float -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=ARM-HARDFP %s +// CHECK-ARM-HARDFP: as{{(.exe)?}}" "-mfloat-abi=hard"