diff options
author | Dan Gohman <dan433584@gmail.com> | 2019-01-24 20:33:28 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2019-01-24 20:33:28 +0000 |
commit | 70f6c8251dc10fe358458a4aa9be4f16463cfe26 (patch) | |
tree | b1fb4f2cd563b2b57e572b813b827b87e14f9591 | |
parent | c0b19b978c318c2e4403f869f5c83b5ce2bd01dc (diff) |
[WebAssembly] Support __float128
This enables support for the "__float128" keyword.
Differential Revision: https://reviews.llvm.org/D57154
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352100 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Basic/Targets/OSTargets.h | 3 | ||||
-rw-r--r-- | test/Preprocessor/init.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/Basic/Targets/OSTargets.h b/lib/Basic/Targets/OSTargets.h index e183b3c24c..7fe3ca9cd1 100644 --- a/lib/Basic/Targets/OSTargets.h +++ b/lib/Basic/Targets/OSTargets.h @@ -771,6 +771,8 @@ class LLVM_LIBRARY_VISIBILITY WebAssemblyOSTargetInfo // Follow g++ convention and predefine _GNU_SOURCE for C++. if (Opts.CPlusPlus) Builder.defineMacro("_GNU_SOURCE"); + // Indicate that we have __float128. + Builder.defineMacro("__FLOAT128__"); } public: @@ -779,6 +781,7 @@ public: : OSTargetInfo<Target>(Triple, Opts) { this->MCountName = "__mcount"; this->TheCXXABI.set(TargetCXXABI::WebAssembly); + this->HasFloat128 = true; } }; diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index d852102424..c88881edd0 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -9159,6 +9159,7 @@ // WEBASSEMBLY-NEXT:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__ // WEBASSEMBLY-NOT:#define __ELF__ // WEBASSEMBLY-NEXT:#define __FINITE_MATH_ONLY__ 0 +// WEBASSEMBLY-NEXT:#define __FLOAT128__ 1 // WEBASSEMBLY-NEXT:#define __FLT16_DECIMAL_DIG__ 5 // WEBASSEMBLY-NEXT:#define __FLT16_DENORM_MIN__ 5.9604644775390625e-8F16 // WEBASSEMBLY-NEXT:#define __FLT16_DIG__ 3 |