diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp --- a/clang/lib/Basic/Targets/PPC.cpp +++ b/clang/lib/Basic/Targets/PPC.cpp @@ -172,6 +172,11 @@ Builder.defineMacro("__LONG_DOUBLE_IBM128__"); } + if (getTriple().isOSAIX() && Opts.LongDoubleSize == 64) { + assert(LongDoubleWidth == 64); + Builder.defineMacro("__LONGDOUBLE64"); + } + // Define this for elfv2 (64-bit only) or 64-bit darwin. if (ABI == "elfv2" || (getTriple().getOS() == llvm::Triple::Darwin && PointerWidth == 64)) diff --git a/clang/test/Preprocessor/init-ppc.c b/clang/test/Preprocessor/init-ppc.c --- a/clang/test/Preprocessor/init-ppc.c +++ b/clang/test/Preprocessor/init-ppc.c @@ -757,6 +757,9 @@ // PPC-AIX-STDC-N-NOT:#define __STDC_NO_ATOMICS__ 1 // PPC-AIX-STDC-N-NOT:#define __STDC_NO_THREADS__ 1 +// 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 +// PPC-AIX-LD64:#define __LONGDOUBLE64 1 + // 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 // // PPC-LINUX:#define _ARCH_PPC 1