]> granicus.if.org Git - clang/commitdiff
Merging r295635:
authorBrad Smith <brad@comstyle.com>
Sat, 22 Apr 2017 16:53:19 +0000 (16:53 +0000)
committerBrad Smith <brad@comstyle.com>
Sat, 22 Apr 2017 16:53:19 +0000 (16:53 +0000)
------------------------------------------------------------------------
r295635 | brad | 2017-02-19 22:18:15 -0500 (Sun, 19 Feb 2017) | 5 lines

Enable support for __float128 in Clang on OpenBSD/X86

/usr/local/include/c++/4.9.4/type_traits:279:39: error: __float128 is not
supported on this target
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@301084 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/CodeGenCXX/float128-declarations.cpp

index 1a95ff26816e78ea690420520c783086414a2597..511bce94b09fd33cbba9e394b9ae01f15ce26b8f 100644 (file)
@@ -545,6 +545,8 @@ protected:
     Builder.defineMacro("__ELF__");
     if (Opts.POSIXThreads)
       Builder.defineMacro("_REENTRANT");
+    if (this->HasFloat128)
+      Builder.defineMacro("__FLOAT128__");
   }
 public:
   OpenBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
@@ -552,11 +554,11 @@ public:
     this->TLSSupported = false;
 
       switch (Triple.getArch()) {
-        default:
         case llvm::Triple::x86:
         case llvm::Triple::x86_64:
-        case llvm::Triple::arm:
-        case llvm::Triple::sparc:
+          this->HasFloat128 = true;
+          // FALLTHROUGH
+        default:
           this->MCountName = "__mcount";
           break;
         case llvm::Triple::mips64:
index e1604a61cac7c8daf44f6c2640a345d0be77eb1c..f1db8f41c608c1d4e009250a38f49073a4bec482 100644 (file)
@@ -8,6 +8,10 @@
 // RUN:   %s -o - | FileCheck %s -check-prefix=CHECK-X86
 // RUN: %clang_cc1 -emit-llvm -triple systemz-unknown-linux-gnu -std=c++11 \
 // RUN:   %s -o - | FileCheck %s -check-prefix=CHECK-SYSZ
+// RUN: %clang_cc1 -emit-llvm -triple i686-pc-openbsd -std=c++11 \
+// RUN:   %s -o - | FileCheck %s -check-prefix=CHECK-X86
+// RUN: %clang_cc1 -emit-llvm -triple amd64-pc-openbsd -std=c++11 \
+// RUN:   %s -o - | FileCheck %s -check-prefix=CHECK-X86
 //
 /*  Various contexts where type __float128 can appear. The different check
     prefixes are due to different mangling on X86 and different calling