From 3896b8c2cce13934c2e2cda6ee94b9ee70546f1e Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Sat, 25 Mar 2017 06:37:23 +0000 Subject: [PATCH] Add the __LONGDOUBLE128 define for ppc targets that have 128 bit long doubles. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298770 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Targets.cpp | 4 +++- test/Preprocessor/init.c | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index e2db335cb3..9255cf8362 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -1248,8 +1248,10 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__REGISTER_PREFIX__", ""); // FIXME: Should be controlled by command line option. - if (LongDoubleWidth == 128) + if (LongDoubleWidth == 128) { Builder.defineMacro("__LONG_DOUBLE_128__"); + Builder.defineMacro("__LONGDOUBLE128"); + } // Define this for elfv2 (64-bit only) or 64-bit darwin. if (ABI == "elfv2" || diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index 5505548105..2de3230a6b 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -5436,6 +5436,7 @@ // PPC603E:#define __LDBL_MIN_10_EXP__ (-291) // PPC603E:#define __LDBL_MIN_EXP__ (-968) // PPC603E:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L +// PPC603E:#define __LONGDOUBLE128 1 // PPC603E:#define __LONG_DOUBLE_128__ 1 // PPC603E:#define __LONG_LONG_MAX__ 9223372036854775807LL // PPC603E:#define __LONG_MAX__ 2147483647L @@ -5638,6 +5639,7 @@ // PPC64:#define __LDBL_MIN_10_EXP__ (-291) // PPC64:#define __LDBL_MIN_EXP__ (-968) // PPC64:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L +// PPC64:#define __LONGDOUBLE128 1 // PPC64:#define __LONG_DOUBLE_128__ 1 // PPC64:#define __LONG_LONG_MAX__ 9223372036854775807LL // PPC64:#define __LONG_MAX__ 9223372036854775807L @@ -5843,6 +5845,7 @@ // PPC64LE:#define __LDBL_MIN_EXP__ (-968) // PPC64LE:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L // PPC64LE:#define __LITTLE_ENDIAN__ 1 +// PPC64LE:#define __LONGDOUBLE128 1 // PPC64LE:#define __LONG_DOUBLE_128__ 1 // PPC64LE:#define __LONG_LONG_MAX__ 9223372036854775807LL // PPC64LE:#define __LONG_MAX__ 9223372036854775807L @@ -6262,6 +6265,7 @@ // PPC64-LINUX:#define __LDBL_MIN_10_EXP__ (-291) // PPC64-LINUX:#define __LDBL_MIN_EXP__ (-968) // PPC64-LINUX:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L +// PPC64-LINUX:#define __LONGDOUBLE128 1 // PPC64-LINUX:#define __LONG_DOUBLE_128__ 1 // PPC64-LINUX:#define __LONG_LONG_MAX__ 9223372036854775807LL // PPC64-LINUX:#define __LONG_MAX__ 9223372036854775807L @@ -6474,6 +6478,7 @@ // PPC:#define __LDBL_MIN_10_EXP__ (-291) // PPC:#define __LDBL_MIN_EXP__ (-968) // PPC:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L +// PPC:#define __LONGDOUBLE128 1 // PPC:#define __LONG_DOUBLE_128__ 1 // PPC:#define __LONG_LONG_MAX__ 9223372036854775807LL // PPC:#define __LONG_MAX__ 2147483647L @@ -6666,6 +6671,7 @@ // PPC-LINUX:#define __LDBL_MIN_10_EXP__ (-291) // PPC-LINUX:#define __LDBL_MIN_EXP__ (-968) // PPC-LINUX:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L +// PPC-LINUX:#define __LONGDOUBLE128 1 // PPC-LINUX:#define __LONG_DOUBLE_128__ 1 // PPC-LINUX:#define __LONG_LONG_MAX__ 9223372036854775807LL // PPC-LINUX:#define __LONG_MAX__ 2147483647L @@ -6858,6 +6864,7 @@ // PPC-DARWIN:#define __LDBL_MIN_10_EXP__ (-291) // PPC-DARWIN:#define __LDBL_MIN_EXP__ (-968) // PPC-DARWIN:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L +// PPC-DARWIN:#define __LONGDOUBLE128 1 // PPC-DARWIN:#define __LONG_DOUBLE_128__ 1 // PPC-DARWIN:#define __LONG_LONG_MAX__ 9223372036854775807LL // PPC-DARWIN:#define __LONG_MAX__ 2147483647L -- 2.40.0