r182029 - fix PR 15726: ptrdiff_t should be int on PowerPC Darwin
David Fang
fang at csl.cornell.edu
Thu May 16 10:51:48 PDT 2013
Author: fangism
Date: Thu May 16 12:51:48 2013
New Revision: 182029
URL: http://llvm.org/viewvc/llvm-project?rev=182029&view=rev
Log:
fix PR 15726: ptrdiff_t should be int on PowerPC Darwin
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=182029&r1=182028&r2=182029&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu May 16 12:51:48 2013
@@ -1220,6 +1220,7 @@ public:
: DarwinTargetInfo<PPC32TargetInfo>(triple) {
HasAlignMac68kSupport = true;
BoolWidth = BoolAlign = 32; //XXX support -mone-byte-bool?
+ PtrDiffType = SignedInt; // for http://llvm.org/bugs/show_bug.cgi?id=15726
LongLongAlign = 32;
SuitableAlign = 128;
DescriptionString = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=182029&r1=182028&r2=182029&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Thu May 16 12:51:48 2013
@@ -2195,6 +2195,112 @@
// PPC-LINUX:#define __powerpc__ 1
// PPC-LINUX:#define __ppc__ 1
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-apple-darwin8 < /dev/null | FileCheck -check-prefix PPC-DARWIN %s
+//
+// PPC-DARWIN:#define _ARCH_PPC 1
+// PPC-DARWIN:#define _BIG_ENDIAN 1
+// PPC-DARWIN:#define __BIG_ENDIAN__ 1
+// PPC-DARWIN:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
+// PPC-DARWIN:#define __CHAR16_TYPE__ unsigned short
+// PPC-DARWIN:#define __CHAR32_TYPE__ unsigned int
+// PPC-DARWIN:#define __CHAR_BIT__ 8
+// PPC-DARWIN:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// PPC-DARWIN:#define __DBL_DIG__ 15
+// PPC-DARWIN:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// PPC-DARWIN:#define __DBL_HAS_DENORM__ 1
+// PPC-DARWIN:#define __DBL_HAS_INFINITY__ 1
+// PPC-DARWIN:#define __DBL_HAS_QUIET_NAN__ 1
+// PPC-DARWIN:#define __DBL_MANT_DIG__ 53
+// PPC-DARWIN:#define __DBL_MAX_10_EXP__ 308
+// PPC-DARWIN:#define __DBL_MAX_EXP__ 1024
+// PPC-DARWIN:#define __DBL_MAX__ 1.7976931348623157e+308
+// PPC-DARWIN:#define __DBL_MIN_10_EXP__ (-307)
+// PPC-DARWIN:#define __DBL_MIN_EXP__ (-1021)
+// PPC-DARWIN:#define __DBL_MIN__ 2.2250738585072014e-308
+// PPC-DARWIN:#define __DECIMAL_DIG__ 33
+// PPC-DARWIN:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// PPC-DARWIN:#define __FLT_DIG__ 6
+// PPC-DARWIN:#define __FLT_EPSILON__ 1.19209290e-7F
+// PPC-DARWIN:#define __FLT_EVAL_METHOD__ 0
+// PPC-DARWIN:#define __FLT_HAS_DENORM__ 1
+// PPC-DARWIN:#define __FLT_HAS_INFINITY__ 1
+// PPC-DARWIN:#define __FLT_HAS_QUIET_NAN__ 1
+// PPC-DARWIN:#define __FLT_MANT_DIG__ 24
+// PPC-DARWIN:#define __FLT_MAX_10_EXP__ 38
+// PPC-DARWIN:#define __FLT_MAX_EXP__ 128
+// PPC-DARWIN:#define __FLT_MAX__ 3.40282347e+38F
+// PPC-DARWIN:#define __FLT_MIN_10_EXP__ (-37)
+// PPC-DARWIN:#define __FLT_MIN_EXP__ (-125)
+// PPC-DARWIN:#define __FLT_MIN__ 1.17549435e-38F
+// PPC-DARWIN:#define __FLT_RADIX__ 2
+// PPC-DARWIN:#define __INT16_TYPE__ short
+// PPC-DARWIN:#define __INT32_TYPE__ int
+// PPC-DARWIN:#define __INT64_C_SUFFIX__ LL
+// PPC-DARWIN:#define __INT64_TYPE__ long long int
+// PPC-DARWIN:#define __INT8_TYPE__ char
+// PPC-DARWIN:#define __INTMAX_MAX__ 9223372036854775807LL
+// PPC-DARWIN:#define __INTMAX_TYPE__ long long int
+// PPC-DARWIN:#define __INTMAX_WIDTH__ 64
+// PPC-DARWIN:#define __INTPTR_TYPE__ long int
+// PPC-DARWIN:#define __INTPTR_WIDTH__ 32
+// PPC-DARWIN:#define __INT_MAX__ 2147483647
+// PPC-DARWIN:#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
+// PPC-DARWIN:#define __LDBL_DIG__ 31
+// PPC-DARWIN:#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
+// PPC-DARWIN:#define __LDBL_HAS_DENORM__ 1
+// PPC-DARWIN:#define __LDBL_HAS_INFINITY__ 1
+// PPC-DARWIN:#define __LDBL_HAS_QUIET_NAN__ 1
+// PPC-DARWIN:#define __LDBL_MANT_DIG__ 106
+// PPC-DARWIN:#define __LDBL_MAX_10_EXP__ 308
+// PPC-DARWIN:#define __LDBL_MAX_EXP__ 1024
+// PPC-DARWIN:#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
+// PPC-DARWIN:#define __LDBL_MIN_10_EXP__ (-291)
+// PPC-DARWIN:#define __LDBL_MIN_EXP__ (-968)
+// PPC-DARWIN:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
+// PPC-DARWIN:#define __LONG_DOUBLE_128__ 1
+// PPC-DARWIN:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// PPC-DARWIN:#define __LONG_MAX__ 2147483647L
+// PPC-DARWIN:#define __MACH__ 1
+// PPC-DARWIN:#define __NATURAL_ALIGNMENT__ 1
+// PPC-DARWIN:#define __ORDER_BIG_ENDIAN__ 4321
+// PPC-DARWIN:#define __ORDER_LITTLE_ENDIAN__ 1234
+// PPC-DARWIN:#define __ORDER_PDP_ENDIAN__ 3412
+// PPC-DARWIN:#define __POINTER_WIDTH__ 32
+// PPC-DARWIN:#define __POWERPC__ 1
+// PPC-DARWIN:#define __PTRDIFF_TYPE__ int
+// PPC-DARWIN:#define __PTRDIFF_WIDTH__ 32
+// PPC-DARWIN:#define __REGISTER_PREFIX__
+// PPC-DARWIN:#define __SCHAR_MAX__ 127
+// PPC-DARWIN:#define __SHRT_MAX__ 32767
+// PPC-DARWIN:#define __SIG_ATOMIC_WIDTH__ 32
+// PPC-DARWIN:#define __SIZEOF_DOUBLE__ 8
+// PPC-DARWIN:#define __SIZEOF_FLOAT__ 4
+// PPC-DARWIN:#define __SIZEOF_INT__ 4
+// PPC-DARWIN:#define __SIZEOF_LONG_DOUBLE__ 16
+// PPC-DARWIN:#define __SIZEOF_LONG_LONG__ 8
+// PPC-DARWIN:#define __SIZEOF_LONG__ 4
+// PPC-DARWIN:#define __SIZEOF_POINTER__ 4
+// PPC-DARWIN:#define __SIZEOF_PTRDIFF_T__ 4
+// PPC-DARWIN:#define __SIZEOF_SHORT__ 2
+// PPC-DARWIN:#define __SIZEOF_SIZE_T__ 4
+// PPC-DARWIN:#define __SIZEOF_WCHAR_T__ 4
+// PPC-DARWIN:#define __SIZEOF_WINT_T__ 4
+// PPC-DARWIN:#define __SIZE_MAX__ 4294967295UL
+// PPC-DARWIN:#define __SIZE_TYPE__ long unsigned int
+// PPC-DARWIN:#define __SIZE_WIDTH__ 32
+// PPC-DARWIN:#define __STDC_HOSTED__ 0
+// PPC-DARWIN:#define __STDC_VERSION__ 199901L
+// PPC-DARWIN:#define __STDC__ 1
+// PPC-DARWIN:#define __UINTMAX_TYPE__ long long unsigned int
+// PPC-DARWIN:#define __USER_LABEL_PREFIX__ _
+// PPC-DARWIN:#define __WCHAR_MAX__ 2147483647
+// PPC-DARWIN:#define __WCHAR_TYPE__ int
+// PPC-DARWIN:#define __WCHAR_WIDTH__ 32
+// PPC-DARWIN:#define __WINT_TYPE__ int
+// PPC-DARWIN:#define __WINT_WIDTH__ 32
+// PPC-DARWIN:#define __powerpc__ 1
+// PPC-DARWIN:#define __ppc__ 1
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=s390x-none-none -fno-signed-char < /dev/null | FileCheck -check-prefix S390X %s
//
// S390X:#define __CHAR16_TYPE__ unsigned short
More information about the cfe-commits
mailing list