Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -332,6 +332,8 @@ return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(Triple, Opts); + case llvm::Triple::AIX: + return new AIXPPC32TargetInfo(Triple, Opts); default: return new PPC32TargetInfo(Triple, Opts); } @@ -348,6 +350,8 @@ return new FreeBSDTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); + case llvm::Triple::AIX: + return new AIXPPC64TargetInfo(Triple, Opts); default: return new PPC64TargetInfo(Triple, Opts); } Index: lib/Basic/Targets/OSTargets.h =================================================================== --- lib/Basic/Targets/OSTargets.h +++ lib/Basic/Targets/OSTargets.h @@ -613,6 +613,53 @@ } }; +// AIX Target +template +class AIXTargetInfo : public OSTargetInfo { +protected: + void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, + MacroBuilder &Builder) const override { + DefineStd(Builder, "unix", Opts); + Builder.defineMacro("_IBMR2"); + Builder.defineMacro("_POWER"); + + // FIXME: Define AIX OS-Version Macros. + Builder.defineMacro("_AIX"); + + // FIXME: Do not define _LONG_LONG when -fno-long-long is specified. + Builder.defineMacro("_LONG_LONG"); + + if (Opts.POSIXThreads) { + Builder.defineMacro("_THREAD_SAFE"); + } + + if (this->PointerWidth == 64) { + Builder.defineMacro("__64BIT__"); + } + + // Define _WCHAR_T when it is a fundamental type + // (i.e., for C++ without -fno-wchar). + if (Opts.CPlusPlus && Opts.WChar) { + Builder.defineMacro("_WCHAR_T"); + } + } + +public: + AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) + : OSTargetInfo(Triple, Opts) { + if (this->PointerWidth == 64) { + this->WCharType = this->UnsignedInt; + } else { + this->WCharType = this->UnsignedShort; + } + this->UseZeroLengthBitfieldAlignment = true; + } + + // AIX sets FLT_EVAL_METHOD to be 1. + unsigned getFloatEvalMethod() const override { return 1; } + bool hasInt128Type() const override { return false; } +}; + // Windows target template class LLVM_LIBRARY_VISIBILITY WindowsTargetInfo : public OSTargetInfo { Index: lib/Basic/Targets/PPC.h =================================================================== --- lib/Basic/Targets/PPC.h +++ lib/Basic/Targets/PPC.h @@ -325,6 +325,12 @@ PtrDiffType = SignedInt; IntPtrType = SignedInt; break; + case llvm::Triple::AIX: + SizeType = UnsignedLong; + PtrDiffType = SignedLong; + IntPtrType = SignedLong; + SuitableAlign = 64; + break; default: break; } @@ -333,6 +339,8 @@ case llvm::Triple::FreeBSD: case llvm::Triple::NetBSD: case llvm::Triple::OpenBSD: + // FIXME: -mlong-double-128 is not yet supported on AIX. + case llvm::Triple::AIX: LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble(); break; @@ -373,6 +381,12 @@ LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble(); break; + case llvm::Triple::AIX: + // FIXME: -mlong-double-128 is not yet supported on AIX. + LongDoubleWidth = LongDoubleAlign = 64; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); + SuitableAlign = 64; + break; default: break; } @@ -431,6 +445,21 @@ } }; +class LLVM_LIBRARY_VISIBILITY AIXPPC32TargetInfo : + public AIXTargetInfo { +public: + using AIXTargetInfo::AIXTargetInfo; + BuiltinVaListKind getBuiltinVaListKind() const override { + return TargetInfo::CharPtrBuiltinVaList; + } +}; + +class LLVM_LIBRARY_VISIBILITY AIXPPC64TargetInfo : + public AIXTargetInfo { +public: + using AIXTargetInfo::AIXTargetInfo; +}; + } // namespace targets } // namespace clang #endif // LLVM_CLANG_LIB_BASIC_TARGETS_PPC_H Index: lib/Basic/Targets/PPC.cpp =================================================================== --- lib/Basic/Targets/PPC.cpp +++ lib/Basic/Targets/PPC.cpp @@ -100,7 +100,9 @@ Builder.defineMacro("_CALL_LINUX", "1"); // Subtarget options. - Builder.defineMacro("__NATURAL_ALIGNMENT__"); + if (!getTriple().isOSAIX()){ + Builder.defineMacro("__NATURAL_ALIGNMENT__"); + } Builder.defineMacro("__REGISTER_PREFIX__", ""); // FIXME: Should be controlled by command line option. Index: test/Driver/types.c =================================================================== --- test/Driver/types.c +++ test/Driver/types.c @@ -9,6 +9,12 @@ // RUN: not %clang -c --target=riscv32-unknown-linux-gnu -fsyntax-only %s \ // RUN: -fforce-enable-int128 -fno-force-enable-int128 +// RUN: not %clang -c --target=powerpc-ibm-aix -fsyntax-only %s \ +// RUN: 2>&1 | FileCheck %s + +// RUN: not %clang -c --target=powerpc64-ibm-aix -fsyntax-only %s \ +// RUN: 2>&1 | FileCheck %s + void a() { __int128_t s; __uint128_t t; Index: test/Headers/max_align.c =================================================================== --- test/Headers/max_align.c +++ test/Headers/max_align.c @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics + +#ifndef __BIGGEST_ALIGNMENT__ +#error __BIGGEST_ALIGNMENT__ not defined +#endif + +#include + +_Static_assert(__BIGGEST_ALIGNMENT__ == _Alignof(max_align_t), ""); Index: test/Preprocessor/init.c =================================================================== --- test/Preprocessor/init.c +++ test/Preprocessor/init.c @@ -6409,6 +6409,209 @@ // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-feature +float128 -target-cpu power9 -fno-signed-char < /dev/null | FileCheck -check-prefix PPC-FLOAT128 %s // PPC-FLOAT128:#define __FLOAT128__ 1 // +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-AIX %s +// +// PPC64-AIX:#define _AIX 1 +// PPC64-AIX:#define _ARCH_PPC 1 +// PPC64-AIX:#define _ARCH_PPC64 1 +// PPC64-AIX:#define _BIG_ENDIAN 1 +// PPC64-AIX:#define _IBMR2 1 +// PPC64-AIX-NOT:#define _ILP32 1 +// PPC64-AIX:#define _LONG_LONG 1 +// PPC64-AIX:#define _LP64 1 +// PPC64-AIX:#define _POWER 1 +// PPC64-AIX:#define __64BIT__ 1 +// PPC64-AIX:#define __BIGGEST_ALIGNMENT__ 8 +// PPC64-AIX:#define __BIG_ENDIAN__ 1 +// PPC64-AIX:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ +// PPC64-AIX:#define __CHAR16_TYPE__ unsigned short +// PPC64-AIX:#define __CHAR32_TYPE__ unsigned int +// PPC64-AIX:#define __CHAR_BIT__ 8 +// PPC64-AIX:#define __CHAR_UNSIGNED__ 1 +// PPC64-AIX:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324 +// PPC64-AIX:#define __DBL_DIG__ 15 +// PPC64-AIX:#define __DBL_EPSILON__ 2.2204460492503131e-16 +// PPC64-AIX:#define __DBL_HAS_DENORM__ 1 +// PPC64-AIX:#define __DBL_HAS_INFINITY__ 1 +// PPC64-AIX:#define __DBL_HAS_QUIET_NAN__ 1 +// PPC64-AIX:#define __DBL_MANT_DIG__ 53 +// PPC64-AIX:#define __DBL_MAX_10_EXP__ 308 +// PPC64-AIX:#define __DBL_MAX_EXP__ 1024 +// PPC64-AIX:#define __DBL_MAX__ 1.7976931348623157e+308 +// PPC64-AIX:#define __DBL_MIN_10_EXP__ (-307) +// PPC64-AIX:#define __DBL_MIN_EXP__ (-1021) +// PPC64-AIX:#define __DBL_MIN__ 2.2250738585072014e-308 +// PPC64-AIX:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__ +// PPC64-AIX:#define __FLT_DENORM_MIN__ 1.40129846e-45F +// PPC64-AIX:#define __FLT_DIG__ 6 +// PPC64-AIX:#define __FLT_EPSILON__ 1.19209290e-7F +// PPC64-AIX:#define __FLT_EVAL_METHOD__ 1 +// PPC64-AIX:#define __FLT_HAS_DENORM__ 1 +// PPC64-AIX:#define __FLT_HAS_INFINITY__ 1 +// PPC64-AIX:#define __FLT_HAS_QUIET_NAN__ 1 +// PPC64-AIX:#define __FLT_MANT_DIG__ 24 +// PPC64-AIX:#define __FLT_MAX_10_EXP__ 38 +// PPC64-AIX:#define __FLT_MAX_EXP__ 128 +// PPC64-AIX:#define __FLT_MAX__ 3.40282347e+38F +// PPC64-AIX:#define __FLT_MIN_10_EXP__ (-37) +// PPC64-AIX:#define __FLT_MIN_EXP__ (-125) +// PPC64-AIX:#define __FLT_MIN__ 1.17549435e-38F +// PPC64-AIX:#define __FLT_RADIX__ 2 +// PPC64-AIX-NOT:#define __ILP32__ 1 +// PPC64-AIX:#define __INT16_C_SUFFIX__ +// PPC64-AIX:#define __INT16_FMTd__ "hd" +// PPC64-AIX:#define __INT16_FMTi__ "hi" +// PPC64-AIX:#define __INT16_MAX__ 32767 +// PPC64-AIX:#define __INT16_TYPE__ short +// PPC64-AIX:#define __INT32_C_SUFFIX__ +// PPC64-AIX:#define __INT32_FMTd__ "d" +// PPC64-AIX:#define __INT32_FMTi__ "i" +// PPC64-AIX:#define __INT32_MAX__ 2147483647 +// PPC64-AIX:#define __INT32_TYPE__ int +// PPC64-AIX:#define __INT64_C_SUFFIX__ L +// PPC64-AIX:#define __INT64_FMTd__ "ld" +// PPC64-AIX:#define __INT64_FMTi__ "li" +// PPC64-AIX:#define __INT64_MAX__ 9223372036854775807L +// PPC64-AIX:#define __INT64_TYPE__ long int +// PPC64-AIX:#define __INT8_C_SUFFIX__ +// PPC64-AIX:#define __INT8_FMTd__ "hhd" +// PPC64-AIX:#define __INT8_FMTi__ "hhi" +// PPC64-AIX:#define __INT8_MAX__ 127 +// PPC64-AIX:#define __INT8_TYPE__ signed char +// PPC64-AIX:#define __INTMAX_C_SUFFIX__ L +// PPC64-AIX:#define __INTMAX_FMTd__ "ld" +// PPC64-AIX:#define __INTMAX_FMTi__ "li" +// PPC64-AIX:#define __INTMAX_MAX__ 9223372036854775807L +// PPC64-AIX:#define __INTMAX_TYPE__ long int +// PPC64-AIX:#define __INTMAX_WIDTH__ 64 +// PPC64-AIX:#define __INTPTR_FMTd__ "ld" +// PPC64-AIX:#define __INTPTR_FMTi__ "li" +// PPC64-AIX:#define __INTPTR_MAX__ 9223372036854775807L +// PPC64-AIX:#define __INTPTR_TYPE__ long int +// PPC64-AIX:#define __INTPTR_WIDTH__ 64 +// PPC64-AIX:#define __INT_FAST16_FMTd__ "hd" +// PPC64-AIX:#define __INT_FAST16_FMTi__ "hi" +// PPC64-AIX:#define __INT_FAST16_MAX__ 32767 +// PPC64-AIX:#define __INT_FAST16_TYPE__ short +// PPC64-AIX:#define __INT_FAST32_FMTd__ "d" +// PPC64-AIX:#define __INT_FAST32_FMTi__ "i" +// PPC64-AIX:#define __INT_FAST32_MAX__ 2147483647 +// PPC64-AIX:#define __INT_FAST32_TYPE__ int +// PPC64-AIX:#define __INT_FAST64_FMTd__ "ld" +// PPC64-AIX:#define __INT_FAST64_FMTi__ "li" +// PPC64-AIX:#define __INT_FAST64_MAX__ 9223372036854775807L +// PPC64-AIX:#define __INT_FAST64_TYPE__ long int +// PPC64-AIX:#define __INT_FAST8_FMTd__ "hhd" +// PPC64-AIX:#define __INT_FAST8_FMTi__ "hhi" +// PPC64-AIX:#define __INT_FAST8_MAX__ 127 +// PPC64-AIX:#define __INT_FAST8_TYPE__ signed char +// PPC64-AIX:#define __INT_LEAST16_FMTd__ "hd" +// PPC64-AIX:#define __INT_LEAST16_FMTi__ "hi" +// PPC64-AIX:#define __INT_LEAST16_MAX__ 32767 +// PPC64-AIX:#define __INT_LEAST16_TYPE__ short +// PPC64-AIX:#define __INT_LEAST32_FMTd__ "d" +// PPC64-AIX:#define __INT_LEAST32_FMTi__ "i" +// PPC64-AIX:#define __INT_LEAST32_MAX__ 2147483647 +// PPC64-AIX:#define __INT_LEAST32_TYPE__ int +// PPC64-AIX:#define __INT_LEAST64_FMTd__ "ld" +// PPC64-AIX:#define __INT_LEAST64_FMTi__ "li" +// PPC64-AIX:#define __INT_LEAST64_MAX__ 9223372036854775807L +// PPC64-AIX:#define __INT_LEAST64_TYPE__ long int +// PPC64-AIX:#define __INT_LEAST8_FMTd__ "hhd" +// PPC64-AIX:#define __INT_LEAST8_FMTi__ "hhi" +// PPC64-AIX:#define __INT_LEAST8_MAX__ 127 +// PPC64-AIX:#define __INT_LEAST8_TYPE__ signed char +// PPC64-AIX:#define __INT_MAX__ 2147483647 +// PPC64-AIX:#define __LDBL_DECIMAL_DIG__ 17 +// PPC64-AIX:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L +// PPC64-AIX:#define __LDBL_DIG__ 15 +// PPC64-AIX:#define __LDBL_EPSILON__ 2.2204460492503131e-16L +// PPC64-AIX:#define __LDBL_HAS_DENORM__ 1 +// PPC64-AIX:#define __LDBL_HAS_INFINITY__ 1 +// PPC64-AIX:#define __LDBL_HAS_QUIET_NAN__ 1 +// PPC64-AIX:#define __LDBL_MANT_DIG__ 53 +// PPC64-AIX:#define __LDBL_MAX_10_EXP__ 308 +// PPC64-AIX:#define __LDBL_MAX_EXP__ 1024 +// PPC64-AIX:#define __LDBL_MAX__ 1.7976931348623157e+308L +// PPC64-AIX:#define __LDBL_MIN_10_EXP__ (-307) +// PPC64-AIX:#define __LDBL_MIN_EXP__ (-1021) +// PPC64-AIX:#define __LDBL_MIN__ 2.2250738585072014e-308L +// PPC64-AIX:#define __LONG_LONG_MAX__ 9223372036854775807LL +// PPC64-AIX:#define __LONG_MAX__ 9223372036854775807L +// PPC64-AIX:#define __LP64__ 1 +// PPC64-AIX-NOT:#define __NATURAL_ALIGNMENT__ 1 +// PPC64-AIX:#define __POINTER_WIDTH__ 64 +// PPC64-AIX:#define __POWERPC__ 1 +// PPC64-AIX:#define __PPC64__ 1 +// PPC64-AIX:#define __PPC__ 1 +// PPC64-AIX:#define __PTRDIFF_TYPE__ long int +// PPC64-AIX:#define __PTRDIFF_WIDTH__ 64 +// PPC64-AIX:#define __REGISTER_PREFIX__ +// PPC64-AIX:#define __SCHAR_MAX__ 127 +// PPC64-AIX:#define __SHRT_MAX__ 32767 +// PPC64-AIX:#define __SIG_ATOMIC_MAX__ 2147483647 +// PPC64-AIX:#define __SIG_ATOMIC_WIDTH__ 32 +// PPC64-AIX:#define __SIZEOF_DOUBLE__ 8 +// PPC64-AIX:#define __SIZEOF_FLOAT__ 4 +// PPC64-AIX:#define __SIZEOF_INT__ 4 +// PPC64-AIX:#define __SIZEOF_LONG_DOUBLE__ 8 +// PPC64-AIX:#define __SIZEOF_LONG_LONG__ 8 +// PPC64-AIX:#define __SIZEOF_LONG__ 8 +// PPC64-AIX:#define __SIZEOF_POINTER__ 8 +// PPC64-AIX:#define __SIZEOF_PTRDIFF_T__ 8 +// PPC64-AIX:#define __SIZEOF_SHORT__ 2 +// PPC64-AIX:#define __SIZEOF_SIZE_T__ 8 +// PPC64-AIX:#define __SIZEOF_WCHAR_T__ 4 +// PPC64-AIX:#define __SIZEOF_WINT_T__ 4 +// PPC64-AIX:#define __SIZE_MAX__ 18446744073709551615UL +// PPC64-AIX:#define __SIZE_TYPE__ long unsigned int +// PPC64-AIX:#define __SIZE_WIDTH__ 64 +// PPC64-AIX:#define __UINT16_C_SUFFIX__ +// PPC64-AIX:#define __UINT16_MAX__ 65535 +// PPC64-AIX:#define __UINT16_TYPE__ unsigned short +// PPC64-AIX:#define __UINT32_C_SUFFIX__ U +// PPC64-AIX:#define __UINT32_MAX__ 4294967295U +// PPC64-AIX:#define __UINT32_TYPE__ unsigned int +// PPC64-AIX:#define __UINT64_C_SUFFIX__ UL +// PPC64-AIX:#define __UINT64_MAX__ 18446744073709551615UL +// PPC64-AIX:#define __UINT64_TYPE__ long unsigned int +// PPC64-AIX:#define __UINT8_C_SUFFIX__ +// PPC64-AIX:#define __UINT8_MAX__ 255 +// PPC64-AIX:#define __UINT8_TYPE__ unsigned char +// PPC64-AIX:#define __UINTMAX_C_SUFFIX__ UL +// PPC64-AIX:#define __UINTMAX_MAX__ 18446744073709551615UL +// PPC64-AIX:#define __UINTMAX_TYPE__ long unsigned int +// PPC64-AIX:#define __UINTMAX_WIDTH__ 64 +// PPC64-AIX:#define __UINTPTR_MAX__ 18446744073709551615UL +// PPC64-AIX:#define __UINTPTR_TYPE__ long unsigned int +// PPC64-AIX:#define __UINTPTR_WIDTH__ 64 +// PPC64-AIX:#define __UINT_FAST16_MAX__ 65535 +// PPC64-AIX:#define __UINT_FAST16_TYPE__ unsigned short +// PPC64-AIX:#define __UINT_FAST32_MAX__ 4294967295U +// PPC64-AIX:#define __UINT_FAST32_TYPE__ unsigned int +// PPC64-AIX:#define __UINT_FAST64_MAX__ 18446744073709551615UL +// PPC64-AIX:#define __UINT_FAST64_TYPE__ long unsigned int +// PPC64-AIX:#define __UINT_FAST8_MAX__ 255 +// PPC64-AIX:#define __UINT_FAST8_TYPE__ unsigned char +// PPC64-AIX:#define __UINT_LEAST16_MAX__ 65535 +// PPC64-AIX:#define __UINT_LEAST16_TYPE__ unsigned short +// PPC64-AIX:#define __UINT_LEAST32_MAX__ 4294967295U +// PPC64-AIX:#define __UINT_LEAST32_TYPE__ unsigned int +// PPC64-AIX:#define __UINT_LEAST64_MAX__ 18446744073709551615UL +// PPC64-AIX:#define __UINT_LEAST64_TYPE__ long unsigned int +// PPC64-AIX:#define __UINT_LEAST8_MAX__ 255 +// PPC64-AIX:#define __UINT_LEAST8_TYPE__ unsigned char +// PPC64-AIX:#define __USER_LABEL_PREFIX__ +// PPC64-AIX:#define __WCHAR_MAX__ 4294967295U +// PPC64-AIX:#define __WCHAR_TYPE__ unsigned int +// PPC64-AIX:#define __WCHAR_WIDTH__ 32 +// PPC64-AIX:#define __WINT_TYPE__ int +// PPC64-AIX:#define __WINT_WIDTH__ 32 +// PPC64-AIX:#define __powerpc64__ 1 +// PPC64-AIX:#define __powerpc__ 1 +// PPC64-AIX:#define __ppc64__ 1 +// PPC64-AIX:#define __ppc__ 1 +// // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-LINUX %s // // PPC64-LINUX:#define _ARCH_PPC 1 @@ -6817,6 +7020,218 @@ // PPC:#define __WINT_WIDTH__ 32 // PPC:#define __ppc__ 1 // +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX %s +// +// PPC-AIX-NOT:#define __64BIT__ 1 +// PPC-AIX:#define _AIX 1 +// PPC-AIX:#define _ARCH_PPC 1 +// PPC-AIX:#define _BIG_ENDIAN 1 +// PPC-AIX:#define _IBMR2 1 +// PPC-AIX:#define _LONG_LONG 1 +// PPC-AIX-NOT:#define _LP64 1 +// PPC-AIX:#define _POWER 1 +// PPC-AIX:#define __BIGGEST_ALIGNMENT__ 8 +// PPC-AIX:#define __BIG_ENDIAN__ 1 +// PPC-AIX:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ +// PPC-AIX:#define __CHAR16_TYPE__ unsigned short +// PPC-AIX:#define __CHAR32_TYPE__ unsigned int +// PPC-AIX:#define __CHAR_BIT__ 8 +// PPC-AIX:#define __CHAR_UNSIGNED__ 1 +// PPC-AIX:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324 +// PPC-AIX:#define __DBL_DIG__ 15 +// PPC-AIX:#define __DBL_EPSILON__ 2.2204460492503131e-16 +// PPC-AIX:#define __DBL_HAS_DENORM__ 1 +// PPC-AIX:#define __DBL_HAS_INFINITY__ 1 +// PPC-AIX:#define __DBL_HAS_QUIET_NAN__ 1 +// PPC-AIX:#define __DBL_MANT_DIG__ 53 +// PPC-AIX:#define __DBL_MAX_10_EXP__ 308 +// PPC-AIX:#define __DBL_MAX_EXP__ 1024 +// PPC-AIX:#define __DBL_MAX__ 1.7976931348623157e+308 +// PPC-AIX:#define __DBL_MIN_10_EXP__ (-307) +// PPC-AIX:#define __DBL_MIN_EXP__ (-1021) +// PPC-AIX:#define __DBL_MIN__ 2.2250738585072014e-308 +// PPC-AIX:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__ +// PPC-AIX:#define __FLT_DENORM_MIN__ 1.40129846e-45F +// PPC-AIX:#define __FLT_DIG__ 6 +// PPC-AIX:#define __FLT_EPSILON__ 1.19209290e-7F +// PPC-AIX:#define __FLT_EVAL_METHOD__ 1 +// PPC-AIX:#define __FLT_HAS_DENORM__ 1 +// PPC-AIX:#define __FLT_HAS_INFINITY__ 1 +// PPC-AIX:#define __FLT_HAS_QUIET_NAN__ 1 +// PPC-AIX:#define __FLT_MANT_DIG__ 24 +// PPC-AIX:#define __FLT_MAX_10_EXP__ 38 +// PPC-AIX:#define __FLT_MAX_EXP__ 128 +// PPC-AIX:#define __FLT_MAX__ 3.40282347e+38F +// PPC-AIX:#define __FLT_MIN_10_EXP__ (-37) +// PPC-AIX:#define __FLT_MIN_EXP__ (-125) +// PPC-AIX:#define __FLT_MIN__ 1.17549435e-38F +// PPC-AIX:#define __FLT_RADIX__ 2 +// PPC-AIX:#define __INT16_C_SUFFIX__ +// PPC-AIX:#define __INT16_FMTd__ "hd" +// PPC-AIX:#define __INT16_FMTi__ "hi" +// PPC-AIX:#define __INT16_MAX__ 32767 +// PPC-AIX:#define __INT16_TYPE__ short +// PPC-AIX:#define __INT32_C_SUFFIX__ +// PPC-AIX:#define __INT32_FMTd__ "d" +// PPC-AIX:#define __INT32_FMTi__ "i" +// PPC-AIX:#define __INT32_MAX__ 2147483647 +// PPC-AIX:#define __INT32_TYPE__ int +// PPC-AIX:#define __INT64_C_SUFFIX__ LL +// PPC-AIX:#define __INT64_FMTd__ "lld" +// PPC-AIX:#define __INT64_FMTi__ "lli" +// PPC-AIX:#define __INT64_MAX__ 9223372036854775807LL +// PPC-AIX:#define __INT64_TYPE__ long long int +// PPC-AIX:#define __INT8_C_SUFFIX__ +// PPC-AIX:#define __INT8_FMTd__ "hhd" +// PPC-AIX:#define __INT8_FMTi__ "hhi" +// PPC-AIX:#define __INT8_MAX__ 127 +// PPC-AIX:#define __INT8_TYPE__ signed char +// PPC-AIX:#define __INTMAX_C_SUFFIX__ LL +// PPC-AIX:#define __INTMAX_FMTd__ "lld" +// PPC-AIX:#define __INTMAX_FMTi__ "lli" +// PPC-AIX:#define __INTMAX_MAX__ 9223372036854775807LL +// PPC-AIX:#define __INTMAX_TYPE__ long long int +// PPC-AIX:#define __INTMAX_WIDTH__ 64 +// PPC-AIX:#define __INTPTR_FMTd__ "ld" +// PPC-AIX:#define __INTPTR_FMTi__ "li" +// PPC-AIX:#define __INTPTR_MAX__ 2147483647L +// PPC-AIX:#define __INTPTR_TYPE__ long int +// PPC-AIX:#define __INTPTR_WIDTH__ 32 +// PPC-AIX:#define __INT_FAST16_FMTd__ "hd" +// PPC-AIX:#define __INT_FAST16_FMTi__ "hi" +// PPC-AIX:#define __INT_FAST16_MAX__ 32767 +// PPC-AIX:#define __INT_FAST16_TYPE__ short +// PPC-AIX:#define __INT_FAST32_FMTd__ "d" +// PPC-AIX:#define __INT_FAST32_FMTi__ "i" +// PPC-AIX:#define __INT_FAST32_MAX__ 2147483647 +// PPC-AIX:#define __INT_FAST32_TYPE__ int +// PPC-AIX:#define __INT_FAST64_FMTd__ "lld" +// PPC-AIX:#define __INT_FAST64_FMTi__ "lli" +// PPC-AIX:#define __INT_FAST64_MAX__ 9223372036854775807LL +// PPC-AIX:#define __INT_FAST64_TYPE__ long long int +// PPC-AIX:#define __INT_FAST8_FMTd__ "hhd" +// PPC-AIX:#define __INT_FAST8_FMTi__ "hhi" +// PPC-AIX:#define __INT_FAST8_MAX__ 127 +// PPC-AIX:#define __INT_FAST8_TYPE__ signed char +// PPC-AIX:#define __INT_LEAST16_FMTd__ "hd" +// PPC-AIX:#define __INT_LEAST16_FMTi__ "hi" +// PPC-AIX:#define __INT_LEAST16_MAX__ 32767 +// PPC-AIX:#define __INT_LEAST16_TYPE__ short +// PPC-AIX:#define __INT_LEAST32_FMTd__ "d" +// PPC-AIX:#define __INT_LEAST32_FMTi__ "i" +// PPC-AIX:#define __INT_LEAST32_MAX__ 2147483647 +// PPC-AIX:#define __INT_LEAST32_TYPE__ int +// PPC-AIX:#define __INT_LEAST64_FMTd__ "lld" +// PPC-AIX:#define __INT_LEAST64_FMTi__ "lli" +// PPC-AIX:#define __INT_LEAST64_MAX__ 9223372036854775807LL +// PPC-AIX:#define __INT_LEAST64_TYPE__ long long int +// PPC-AIX:#define __INT_LEAST8_FMTd__ "hhd" +// PPC-AIX:#define __INT_LEAST8_FMTi__ "hhi" +// PPC-AIX:#define __INT_LEAST8_MAX__ 127 +// PPC-AIX:#define __INT_LEAST8_TYPE__ signed char +// PPC-AIX:#define __INT_MAX__ 2147483647 +// PPC-AIX:#define __LDBL_DECIMAL_DIG__ 17 +// PPC-AIX:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L +// PPC-AIX:#define __LDBL_DIG__ 15 +// PPC-AIX:#define __LDBL_EPSILON__ 2.2204460492503131e-16L +// PPC-AIX:#define __LDBL_HAS_DENORM__ 1 +// PPC-AIX:#define __LDBL_HAS_INFINITY__ 1 +// PPC-AIX:#define __LDBL_HAS_QUIET_NAN__ 1 +// PPC-AIX:#define __LDBL_MANT_DIG__ 53 +// PPC-AIX:#define __LDBL_MAX_10_EXP__ 308 +// PPC-AIX:#define __LDBL_MAX_EXP__ 1024 +// PPC-AIX:#define __LDBL_MAX__ 1.7976931348623157e+308L +// PPC-AIX:#define __LDBL_MIN_10_EXP__ (-307) +// PPC-AIX:#define __LDBL_MIN_EXP__ (-1021) +// PPC-AIX:#define __LDBL_MIN__ 2.2250738585072014e-308L +// PPC-AIX:#define __LONG_LONG_MAX__ 9223372036854775807LL +// PPC-AIX:#define __LONG_MAX__ 2147483647L +// PPC-AIX-NOT:#define __LP64__ 1 +// PPC-AIX-NOT:#define __NATURAL_ALIGNMENT__ 1 +// PPC-AIX:#define __POINTER_WIDTH__ 32 +// PPC-AIX:#define __POWERPC__ 1 +// PPC-AIX:#define __PPC__ 1 +// PPC-AIX:#define __PTRDIFF_TYPE__ long int +// PPC-AIX:#define __PTRDIFF_WIDTH__ 32 +// PPC-AIX:#define __REGISTER_PREFIX__ +// PPC-AIX:#define __SCHAR_MAX__ 127 +// PPC-AIX:#define __SHRT_MAX__ 32767 +// PPC-AIX:#define __SIG_ATOMIC_MAX__ 2147483647 +// PPC-AIX:#define __SIG_ATOMIC_WIDTH__ 32 +// PPC-AIX:#define __SIZEOF_DOUBLE__ 8 +// PPC-AIX:#define __SIZEOF_FLOAT__ 4 +// PPC-AIX:#define __SIZEOF_INT__ 4 +// PPC-AIX:#define __SIZEOF_LONG_DOUBLE__ 8 +// PPC-AIX:#define __SIZEOF_LONG_LONG__ 8 +// PPC-AIX:#define __SIZEOF_LONG__ 4 +// PPC-AIX:#define __SIZEOF_POINTER__ 4 +// PPC-AIX:#define __SIZEOF_PTRDIFF_T__ 4 +// PPC-AIX:#define __SIZEOF_SHORT__ 2 +// PPC-AIX:#define __SIZEOF_SIZE_T__ 4 +// PPC-AIX:#define __SIZEOF_WCHAR_T__ 2 +// PPC-AIX:#define __SIZEOF_WINT_T__ 4 +// PPC-AIX:#define __SIZE_MAX__ 4294967295UL +// PPC-AIX:#define __SIZE_TYPE__ long unsigned int +// PPC-AIX:#define __SIZE_WIDTH__ 32 +// PPC-AIX:#define __UINT16_C_SUFFIX__ +// PPC-AIX:#define __UINT16_MAX__ 65535 +// PPC-AIX:#define __UINT16_TYPE__ unsigned short +// PPC-AIX:#define __UINT32_C_SUFFIX__ U +// PPC-AIX:#define __UINT32_MAX__ 4294967295U +// PPC-AIX:#define __UINT32_TYPE__ unsigned int +// PPC-AIX:#define __UINT64_C_SUFFIX__ ULL +// PPC-AIX:#define __UINT64_MAX__ 18446744073709551615ULL +// PPC-AIX:#define __UINT64_TYPE__ long long unsigned int +// PPC-AIX:#define __UINT8_C_SUFFIX__ +// PPC-AIX:#define __UINT8_MAX__ 255 +// PPC-AIX:#define __UINT8_TYPE__ unsigned char +// PPC-AIX:#define __UINTMAX_C_SUFFIX__ ULL +// PPC-AIX:#define __UINTMAX_MAX__ 18446744073709551615ULL +// PPC-AIX:#define __UINTMAX_TYPE__ long long unsigned int +// PPC-AIX:#define __UINTMAX_WIDTH__ 64 +// PPC-AIX:#define __UINTPTR_MAX__ 4294967295UL +// PPC-AIX:#define __UINTPTR_TYPE__ long unsigned int +// PPC-AIX:#define __UINTPTR_WIDTH__ 32 +// PPC-AIX:#define __UINT_FAST16_MAX__ 65535 +// PPC-AIX:#define __UINT_FAST16_TYPE__ unsigned short +// PPC-AIX:#define __UINT_FAST32_MAX__ 4294967295U +// PPC-AIX:#define __UINT_FAST32_TYPE__ unsigned int +// PPC-AIX:#define __UINT_FAST64_MAX__ 18446744073709551615ULL +// PPC-AIX:#define __UINT_FAST64_TYPE__ long long unsigned int +// PPC-AIX:#define __UINT_FAST8_MAX__ 255 +// PPC-AIX:#define __UINT_FAST8_TYPE__ unsigned char +// PPC-AIX:#define __UINT_LEAST16_MAX__ 65535 +// PPC-AIX:#define __UINT_LEAST16_TYPE__ unsigned short +// PPC-AIX:#define __UINT_LEAST32_MAX__ 4294967295U +// PPC-AIX:#define __UINT_LEAST32_TYPE__ unsigned int +// PPC-AIX:#define __UINT_LEAST64_MAX__ 18446744073709551615ULL +// PPC-AIX:#define __UINT_LEAST64_TYPE__ long long unsigned int +// PPC-AIX:#define __UINT_LEAST8_MAX__ 255 +// PPC-AIX:#define __UINT_LEAST8_TYPE__ unsigned char +// PPC-AIX:#define __USER_LABEL_PREFIX__ +// PPC-AIX:#define __WCHAR_MAX__ 65535 +// PPC-AIX:#define __WCHAR_TYPE__ unsigned short +// PPC-AIX:#define __WCHAR_WIDTH__ 16 +// PPC-AIX:#define __WINT_TYPE__ int +// PPC-AIX:#define __WINT_WIDTH__ 32 +// PPC-AIX:#define __powerpc__ 1 +// PPC-AIX:#define __ppc__ 1 +// +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-CXX %s +// +// PPC-AIX-CXX:#define _WCHAR_T 1 +// +// RUN: %clang_cc1 -x c++ -fno-wchar -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-NOWCHAR %s +// RUN: %clang_cc1 -x c -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-NOWCHAR %s +// +// PPC-AIX-NOWCHAR-NOT:#define _WCHAR_T 1 +// +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char -pthread < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-THREADSAFE %s +// PPC-AIX-THREADSAFE:#define _THREAD_SAFE 1 +// +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-NOTHREADSAFE %s +// PPC-AIX-NOTHREADSAFE-NOT:#define _THREAD_SAFE 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 Index: test/Sema/varargs-aix.c =================================================================== --- test/Sema/varargs-aix.c +++ test/Sema/varargs-aix.c @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple powerpc-ibm-aix +// RUN: %clang_cc1 -fsyntax-only -verify %s -triple powerpc64-ibm-aix +// expected-no-diagnostics + +extern __builtin_va_list ap; +extern char *ap;