]> granicus.if.org Git - clang/commitdiff
Handle SPARC float command line parameters for SPARCv9.
authorBrad Smith <brad@comstyle.com>
Tue, 19 Aug 2014 21:50:15 +0000 (21:50 +0000)
committerBrad Smith <brad@comstyle.com>
Tue, 19 Aug 2014 21:50:15 +0000 (21:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216029 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/sparc-float.c

index a11de759880849354cc9da25c4281185c76809b4..805847dd6da82a5c4249ce64d972401f3b39dba3 100644 (file)
@@ -1298,7 +1298,7 @@ static std::string getR600TargetGPU(const ArgList &Args) {
 }
 
 static void getSparcTargetFeatures(const ArgList &Args,
-                                   std::vector<const char *> Features) {
+                                   std::vector<const char *> &Features) {
   bool SoftFloatABI = true;
   if (Arg *A =
           Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float)) {
@@ -1801,6 +1801,7 @@ static void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,
     getPPCTargetFeatures(Args, Features);
     break;
   case llvm::Triple::sparc:
+  case llvm::Triple::sparcv9:
     getSparcTargetFeatures(Args, Features);
     break;
   case llvm::Triple::aarch64:
index 15050d2c4ea46c455d6c8418c7d8404f1d0554f0..e84c487c73c987ae517c67210641b28c70ebf0ee 100644 (file)
@@ -5,6 +5,7 @@
 // RUN: %clang -c %s -### -o %t.o 2>&1 \
 // RUN:     -target sparc-linux-gnu \
 // RUN:   | FileCheck --check-prefix=CHECK-DEF %s
+// CHECK-DEF: "-target-feature" "+soft-float"
 // CHECK-DEF: "-msoft-float"
 //
 // -mhard-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: "-target-feature" "+soft-float"
 // 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: "-target-feature" "+soft-float"
 // CHECK-DEF-SPARC64: "-msoft-float"
 //
 // -mhard-float
@@ -35,4 +38,5 @@
 // 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-SPARC64: "-target-feature" "+soft-float"
 // CHECK-SOFT-SPARC64: "-msoft-float"