[PATCH] Handle SPARC float command line parameters for SPARCv9
Brad Smith
brad at comstyle.com
Thu Jul 10 17:10:08 PDT 2014
On Thu, Jul 10, 2014 at 01:49:00PM -0700, Eric Christopher wrote:
> Testcase? :)
How about something like the following?
> -eric
>
> On Thu, Jul 10, 2014 at 1:44 PM, Brad Smith <brad at comstyle.com> wrote:
> > Handle the respective SPARC float command line parameters for SPARCv9.
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
-------------- next part --------------
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp (revision 212648)
+++ lib/Driver/Tools.cpp (working copy)
@@ -1237,7 +1237,7 @@
ArgStringList &CmdArgs) const {
const Driver &D = getToolChain().getDriver();
- // Select the float ABI as determined by -msoft-float, -mhard-float, and
+ // Select the float ABI as determined by -msoft-float and -mhard-float.
StringRef FloatABI;
if (Arg *A = Args.getLastArg(options::OPT_msoft_float,
options::OPT_mhard_float)) {
@@ -2847,6 +2847,7 @@
break;
case llvm::Triple::sparc:
+ case llvm::Triple::sparcv9:
AddSparcTargetArgs(Args, CmdArgs);
break;
Index: test/Driver/sparc-float.c
===================================================================
--- test/Driver/sparc-float.c (revision 0)
+++ test/Driver/sparc-float.c (working copy)
@@ -0,0 +1,38 @@
+// Check handling -mhard-float / -msoft-float options
+// when build for SPARC platforms.
+//
+// Default sparc
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target sparc-linux-gnu \
+// RUN: | FileCheck --check-prefix=CHECK-DEF %s
+// CHECK-DEF: "-msoft-float"
+//
+// -mhard-float
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target sparc-linux-gnu -mhard-float \
+// RUN: | FileCheck --check-prefix=CHECK-HARD %s
+// CHECK-HARD: "-mhard-float"
+//
+// -msoft-float
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target sparc-linux-gnu -msoft-float \
+// RUN: | FileCheck --check-prefix=CHECK-SOFT %s
+// CHECK-SOFT: "-msoft-float"
+//
+// Default sparc64
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target sparc64-linux-gnu \
+// RUN: | FileCheck --check-prefix=CHECK-DEF-SPARC64 %s
+// CHECK-DEF-SPARC64: "-msoft-float"
+//
+// -mhard-float
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target sparc64-linux-gnu -mhard-float \
+// RUN: | FileCheck --check-prefix=CHECK-HARD-SPARC64 %s
+// CHECK-HARD-SPARC64: "-mhard-float"
+//
+// -msoft-float
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target sparc64-linux-gnu -msoft-float \
+// RUN: | FileCheck --check-prefix=CHECK-SOFT-SPARC64 %s
+// CHECK-SOFT-MIPS16: "-msoft-float"
More information about the cfe-commits
mailing list