r185572 - Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.
Roman Divacky
rdivacky at freebsd.org
Wed Jul 3 12:45:54 PDT 2013
Author: rdivacky
Date: Wed Jul 3 14:45:54 2013
New Revision: 185572
URL: http://llvm.org/viewvc/llvm-project?rev=185572&view=rev
Log:
Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.
It's not the case on ie. FreeBSD.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Preprocessor/init.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=185572&r1=185571&r2=185572&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jul 3 14:45:54 2013
@@ -877,7 +877,8 @@ void PPCTargetInfo::getTargetDefines(con
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");
Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=185572&r1=185571&r2=185572&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Wed Jul 3 14:45:54 2013
@@ -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
More information about the cfe-commits
mailing list