From: Roman Divacky Date: Wed, 3 Jul 2013 19:45:54 +0000 (+0000) Subject: Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2f6f4764e4d7da70b9ed99aa5bbb346018feedc;p=clang Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width. It's not the case on ie. FreeBSD. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185572 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index b92e2ace3b..b6fc7a0a23 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -877,7 +877,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__REGISTER_PREFIX__", ""); // FIXME: Should be controlled by command line option. - Builder.defineMacro("__LONG_DOUBLE_128__"); + if (LongDoubleWidth == 128) + Builder.defineMacro("__LONG_DOUBLE_128__"); if (Opts.AltiVec) { Builder.defineMacro("__VEC__", "10206"); diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index 9aa19a6361..7beb344370 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -2826,3 +2826,5 @@ // // RUN: %clang_cc1 -triple arm-linux-androideabi -E -dM < /dev/null | FileCheck -check-prefix ANDROID %s // ANDROID: __ANDROID__ 1 +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd < /dev/null | FileCheck -check-prefix PPC64-FREEBSD %s +// PPC64-FREEBSD-NOT: #define __LONG_DOUBLE_128__ 1