Skip to content

Commit 1b52e9b

Browse files
committed
[AIX] Define __LONGDOUBLE64 macro
This patch defines the macro __LONGDOUBLE64 for AIX when long double is 8 bytes. Reviewed By: cebowleratibm Differential Revision: https://reviews.llvm.org/D105477
1 parent af8fa36 commit 1b52e9b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

clang/lib/Basic/Targets/PPC.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
296296
Builder.defineMacro("__LONG_DOUBLE_IBM128__");
297297
}
298298

299+
if (getTriple().isOSAIX() && Opts.LongDoubleSize == 64) {
300+
assert(LongDoubleWidth == 64);
301+
Builder.defineMacro("__LONGDOUBLE64");
302+
}
303+
299304
// Define this for elfv2 (64-bit only) or 64-bit darwin.
300305
if (ABI == "elfv2" ||
301306
(getTriple().getOS() == llvm::Triple::Darwin && PointerWidth == 64))

clang/test/Preprocessor/init-ppc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,9 @@
758758
// PPC-AIX-STDC-N-NOT:#define __STDC_NO_ATOMICS__ 1
759759
// PPC-AIX-STDC-N-NOT:#define __STDC_NO_THREADS__ 1
760760

761+
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -mlong-double-64 < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-LD64 %s
762+
// PPC-AIX-LD64:#define __LONGDOUBLE64 1
763+
761764
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-unknown-linux-gnu -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-LINUX %s
762765
//
763766
// PPC-LINUX:#define _ARCH_PPC 1

0 commit comments

Comments
 (0)