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 @@ -257,6 +257,9 @@ Builder.defineMacro("__ppc64__"); Builder.defineMacro("__PPC64__"); } + if (getTriple().isOSAIX()) { + Builder.defineMacro("__THW_PPC__"); + } // Target properties. if (getTriple().getArch() == llvm::Triple::ppc64le || 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 @@ -539,6 +539,7 @@ // PPC-AIX:#define __SIZE_TYPE__ long unsigned int // PPC-AIX:#define __SIZE_WIDTH__ 32 // PPC-AIX:#define __THW_BIG_ENDIAN__ 1 +// PPC-AIX:#define __THW_PPC__ 1 // PPC-AIX:#define __TOS_AIX__ 1 // PPC-AIX:#define __UINT16_C_SUFFIX__ // PPC-AIX:#define __UINT16_MAX__ 65535