summaryrefslogtreecommitdiffstats
path: root/test/Preprocessor/stdint.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/Preprocessor/stdint.c
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/Preprocessor/stdint.c')
-rw-r--r--test/Preprocessor/stdint.c332
1 files changed, 327 insertions, 5 deletions
diff --git a/test/Preprocessor/stdint.c b/test/Preprocessor/stdint.c
index c3be05d..b92cfe7 100644
--- a/test/Preprocessor/stdint.c
+++ b/test/Preprocessor/stdint.c
@@ -213,6 +213,220 @@
// I386:INTMAX_C_(0) 0LL
// I386:UINTMAX_C_(0) 0ULL
//
+// RUN: %clang_cc1 -E -ffreestanding -triple=mips-none-none %s | FileCheck -check-prefix MIPS %s
+//
+// MIPS:typedef signed long long int int64_t;
+// MIPS:typedef unsigned long long int uint64_t;
+// MIPS:typedef int64_t int_least64_t;
+// MIPS:typedef uint64_t uint_least64_t;
+// MIPS:typedef int64_t int_fast64_t;
+// MIPS:typedef uint64_t uint_fast64_t;
+//
+// MIPS:typedef signed int int32_t;
+// MIPS:typedef unsigned int uint32_t;
+// MIPS:typedef int32_t int_least32_t;
+// MIPS:typedef uint32_t uint_least32_t;
+// MIPS:typedef int32_t int_fast32_t;
+// MIPS:typedef uint32_t uint_fast32_t;
+//
+// MIPS:typedef signed short int16_t;
+// MIPS:typedef unsigned short uint16_t;
+// MIPS:typedef int16_t int_least16_t;
+// MIPS:typedef uint16_t uint_least16_t;
+// MIPS:typedef int16_t int_fast16_t;
+// MIPS:typedef uint16_t uint_fast16_t;
+//
+// MIPS:typedef signed char int8_t;
+// MIPS:typedef unsigned char uint8_t;
+// MIPS:typedef int8_t int_least8_t;
+// MIPS:typedef uint8_t uint_least8_t;
+// MIPS:typedef int8_t int_fast8_t;
+// MIPS:typedef uint8_t uint_fast8_t;
+//
+// MIPS:typedef int32_t intptr_t;
+// MIPS:typedef uint32_t uintptr_t;
+//
+// MIPS:typedef long long int intmax_t;
+// MIPS:typedef long long unsigned int uintmax_t;
+//
+// MIPS:INT8_MAX_ 127
+// MIPS:INT8_MIN_ (-127 -1)
+// MIPS:UINT8_MAX_ 255
+// MIPS:INT_LEAST8_MIN_ (-127 -1)
+// MIPS:INT_LEAST8_MAX_ 127
+// MIPS:UINT_LEAST8_MAX_ 255
+// MIPS:INT_FAST8_MIN_ (-127 -1)
+// MIPS:INT_FAST8_MAX_ 127
+// MIPS:UINT_FAST8_MAX_ 255
+//
+// MIPS:INT16_MAX_ 32767
+// MIPS:INT16_MIN_ (-32767 -1)
+// MIPS:UINT16_MAX_ 65535
+// MIPS:INT_LEAST16_MIN_ (-32767 -1)
+// MIPS:INT_LEAST16_MAX_ 32767
+// MIPS:UINT_LEAST16_MAX_ 65535
+// MIPS:INT_FAST16_MIN_ (-32767 -1)
+// MIPS:INT_FAST16_MAX_ 32767
+// MIPS:UINT_FAST16_MAX_ 65535
+//
+// MIPS:INT32_MAX_ 2147483647
+// MIPS:INT32_MIN_ (-2147483647 -1)
+// MIPS:UINT32_MAX_ 4294967295U
+// MIPS:INT_LEAST32_MIN_ (-2147483647 -1)
+// MIPS:INT_LEAST32_MAX_ 2147483647
+// MIPS:UINT_LEAST32_MAX_ 4294967295U
+// MIPS:INT_FAST32_MIN_ (-2147483647 -1)
+// MIPS:INT_FAST32_MAX_ 2147483647
+// MIPS:UINT_FAST32_MAX_ 4294967295U
+//
+// MIPS:INT64_MAX_ 9223372036854775807LL
+// MIPS:INT64_MIN_ (-9223372036854775807LL -1)
+// MIPS:UINT64_MAX_ 18446744073709551615ULL
+// MIPS:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
+// MIPS:INT_LEAST64_MAX_ 9223372036854775807LL
+// MIPS:UINT_LEAST64_MAX_ 18446744073709551615ULL
+// MIPS:INT_FAST64_MIN_ (-9223372036854775807LL -1)
+// MIPS:INT_FAST64_MAX_ 9223372036854775807LL
+// MIPS:UINT_FAST64_MAX_ 18446744073709551615ULL
+//
+// MIPS:INTPTR_MIN_ (-2147483647 -1)
+// MIPS:INTPTR_MAX_ 2147483647
+// MIPS:UINTPTR_MAX_ 4294967295U
+// MIPS:PTRDIFF_MIN_ (-2147483647 -1)
+// MIPS:PTRDIFF_MAX_ 2147483647
+// MIPS:SIZE_MAX_ 4294967295U
+//
+// MIPS:INTMAX_MIN_ (-9223372036854775807LL -1)
+// MIPS:INTMAX_MAX_ 9223372036854775807LL
+// MIPS:UINTMAX_MAX_ 18446744073709551615ULL
+//
+// MIPS:SIG_ATOMIC_MIN_ (-2147483647 -1)
+// MIPS:SIG_ATOMIC_MAX_ 2147483647
+// MIPS:WINT_MIN_ (-2147483647 -1)
+// MIPS:WINT_MAX_ 2147483647
+//
+// MIPS:WCHAR_MAX_ 2147483647
+// MIPS:WCHAR_MIN_ (-2147483647 -1)
+//
+// MIPS:INT8_C_(0) 0
+// MIPS:UINT8_C_(0) 0U
+// MIPS:INT16_C_(0) 0
+// MIPS:UINT16_C_(0) 0U
+// MIPS:INT32_C_(0) 0
+// MIPS:UINT32_C_(0) 0U
+// MIPS:INT64_C_(0) 0LL
+// MIPS:UINT64_C_(0) 0ULL
+//
+// MIPS:INTMAX_C_(0) 0LL
+// MIPS:UINTMAX_C_(0) 0ULL
+//
+// RUN: %clang_cc1 -E -ffreestanding -triple=mips64-none-none %s | FileCheck -check-prefix MIPS64 %s
+//
+// MIPS64:typedef signed long long int int64_t;
+// MIPS64:typedef unsigned long long int uint64_t;
+// MIPS64:typedef int64_t int_least64_t;
+// MIPS64:typedef uint64_t uint_least64_t;
+// MIPS64:typedef int64_t int_fast64_t;
+// MIPS64:typedef uint64_t uint_fast64_t;
+//
+// MIPS64:typedef signed int int32_t;
+// MIPS64:typedef unsigned int uint32_t;
+// MIPS64:typedef int32_t int_least32_t;
+// MIPS64:typedef uint32_t uint_least32_t;
+// MIPS64:typedef int32_t int_fast32_t;
+// MIPS64:typedef uint32_t uint_fast32_t;
+//
+// MIPS64:typedef signed short int16_t;
+// MIPS64:typedef unsigned short uint16_t;
+// MIPS64:typedef int16_t int_least16_t;
+// MIPS64:typedef uint16_t uint_least16_t;
+// MIPS64:typedef int16_t int_fast16_t;
+// MIPS64:typedef uint16_t uint_fast16_t;
+//
+// MIPS64:typedef signed char int8_t;
+// MIPS64:typedef unsigned char uint8_t;
+// MIPS64:typedef int8_t int_least8_t;
+// MIPS64:typedef uint8_t uint_least8_t;
+// MIPS64:typedef int8_t int_fast8_t;
+// MIPS64:typedef uint8_t uint_fast8_t;
+//
+// MIPS64:typedef int64_t intptr_t;
+// MIPS64:typedef uint64_t uintptr_t;
+//
+// MIPS64:typedef long long int intmax_t;
+// MIPS64:typedef long long unsigned int uintmax_t;
+//
+// MIPS64:INT8_MAX_ 127
+// MIPS64:INT8_MIN_ (-127 -1)
+// MIPS64:UINT8_MAX_ 255
+// MIPS64:INT_LEAST8_MIN_ (-127 -1)
+// MIPS64:INT_LEAST8_MAX_ 127
+// MIPS64:UINT_LEAST8_MAX_ 255
+// MIPS64:INT_FAST8_MIN_ (-127 -1)
+// MIPS64:INT_FAST8_MAX_ 127
+// MIPS64:UINT_FAST8_MAX_ 255
+//
+// MIPS64:INT16_MAX_ 32767
+// MIPS64:INT16_MIN_ (-32767 -1)
+// MIPS64:UINT16_MAX_ 65535
+// MIPS64:INT_LEAST16_MIN_ (-32767 -1)
+// MIPS64:INT_LEAST16_MAX_ 32767
+// MIPS64:UINT_LEAST16_MAX_ 65535
+// MIPS64:INT_FAST16_MIN_ (-32767 -1)
+// MIPS64:INT_FAST16_MAX_ 32767
+// MIPS64:UINT_FAST16_MAX_ 65535
+//
+// MIPS64:INT32_MAX_ 2147483647
+// MIPS64:INT32_MIN_ (-2147483647 -1)
+// MIPS64:UINT32_MAX_ 4294967295U
+// MIPS64:INT_LEAST32_MIN_ (-2147483647 -1)
+// MIPS64:INT_LEAST32_MAX_ 2147483647
+// MIPS64:UINT_LEAST32_MAX_ 4294967295U
+// MIPS64:INT_FAST32_MIN_ (-2147483647 -1)
+// MIPS64:INT_FAST32_MAX_ 2147483647
+// MIPS64:UINT_FAST32_MAX_ 4294967295U
+//
+// MIPS64:INT64_MAX_ 9223372036854775807LL
+// MIPS64:INT64_MIN_ (-9223372036854775807LL -1)
+// MIPS64:UINT64_MAX_ 18446744073709551615ULL
+// MIPS64:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
+// MIPS64:INT_LEAST64_MAX_ 9223372036854775807LL
+// MIPS64:UINT_LEAST64_MAX_ 18446744073709551615ULL
+// MIPS64:INT_FAST64_MIN_ (-9223372036854775807LL -1)
+// MIPS64:INT_FAST64_MAX_ 9223372036854775807LL
+// MIPS64:UINT_FAST64_MAX_ 18446744073709551615ULL
+//
+// MIPS64:INTPTR_MIN_ (-9223372036854775807LL -1)
+// MIPS64:INTPTR_MAX_ 9223372036854775807LL
+// MIPS64:UINTPTR_MAX_ 18446744073709551615ULL
+// MIPS64:PTRDIFF_MIN_ (-9223372036854775807LL -1)
+// MIPS64:PTRDIFF_MAX_ 9223372036854775807LL
+// MIPS64:SIZE_MAX_ 18446744073709551615ULL
+//
+// MIPS64:INTMAX_MIN_ (-9223372036854775807LL -1)
+// MIPS64:INTMAX_MAX_ 9223372036854775807LL
+// MIPS64:UINTMAX_MAX_ 18446744073709551615ULL
+//
+// MIPS64:SIG_ATOMIC_MIN_ (-2147483647 -1)
+// MIPS64:SIG_ATOMIC_MAX_ 2147483647
+// MIPS64:WINT_MIN_ (-2147483647 -1)
+// MIPS64:WINT_MAX_ 2147483647
+//
+// MIPS64:WCHAR_MAX_ 2147483647
+// MIPS64:WCHAR_MIN_ (-2147483647 -1)
+//
+// MIPS64:INT8_C_(0) 0
+// MIPS64:UINT8_C_(0) 0U
+// MIPS64:INT16_C_(0) 0
+// MIPS64:UINT16_C_(0) 0U
+// MIPS64:INT32_C_(0) 0
+// MIPS64:UINT32_C_(0) 0U
+// MIPS64:INT64_C_(0) 0LL
+// MIPS64:UINT64_C_(0) 0ULL
+//
+// MIPS64:INTMAX_C_(0) 0LL
+// MIPS64:UINTMAX_C_(0) 0ULL
+//
// RUN: %clang_cc1 -E -ffreestanding -triple=msp430-none-none %s | FileCheck -check-prefix MSP430 %s
//
// MSP430:typedef signed long int int32_t;
@@ -239,8 +453,8 @@
// MSP430:typedef int16_t intptr_t;
// MSP430:typedef uint16_t uintptr_t;
//
-// MSP430:typedef long int intmax_t;
-// MSP430:typedef long unsigned int uintmax_t;
+// MSP430:typedef long long int intmax_t;
+// MSP430:typedef long long unsigned int uintmax_t;
//
// MSP430:INT8_MAX_ 127
// MSP430:INT8_MIN_ (-127 -1)
@@ -289,9 +503,9 @@
// MSP430:PTRDIFF_MAX_ 32767
// MSP430:SIZE_MAX_ 65535
//
-// MSP430:INTMAX_MIN_ (-2147483647L -1)
-// MSP430:INTMAX_MAX_ 2147483647L
-// MSP430:UINTMAX_MAX_ 4294967295UL
+// MSP430:INTMAX_MIN_ (-9223372036854775807LL -1)
+// MSP430:INTMAX_MAX_ 9223372036854775807LL
+// MSP430:UINTMAX_MAX_ 18446744073709551615ULL
//
// MSP430:SIG_ATOMIC_MIN_ (-2147483647L -1)
// MSP430:SIG_ATOMIC_MAX_ 2147483647L
@@ -963,6 +1177,114 @@
// I386_MINGW32:WCHAR_MIN_ 0U
//
//
+// RUN: %clang_cc1 -E -ffreestanding -triple=xcore-none-none %s | FileCheck -check-prefix XCORE %s
+//
+// XCORE:typedef signed long long int int64_t;
+// XCORE:typedef unsigned long long int uint64_t;
+// XCORE:typedef int64_t int_least64_t;
+// XCORE:typedef uint64_t uint_least64_t;
+// XCORE:typedef int64_t int_fast64_t;
+// XCORE:typedef uint64_t uint_fast64_t;
+//
+// XCORE:typedef signed int int32_t;
+// XCORE:typedef unsigned int uint32_t;
+// XCORE:typedef int32_t int_least32_t;
+// XCORE:typedef uint32_t uint_least32_t;
+// XCORE:typedef int32_t int_fast32_t;
+// XCORE:typedef uint32_t uint_fast32_t;
+//
+// XCORE:typedef signed short int16_t;
+// XCORE:typedef unsigned short uint16_t;
+// XCORE:typedef int16_t int_least16_t;
+// XCORE:typedef uint16_t uint_least16_t;
+// XCORE:typedef int16_t int_fast16_t;
+// XCORE:typedef uint16_t uint_fast16_t;
+//
+// XCORE:typedef signed char int8_t;
+// XCORE:typedef unsigned char uint8_t;
+// XCORE:typedef int8_t int_least8_t;
+// XCORE:typedef uint8_t uint_least8_t;
+// XCORE:typedef int8_t int_fast8_t;
+// XCORE:typedef uint8_t uint_fast8_t;
+//
+// XCORE:typedef int32_t intptr_t;
+// XCORE:typedef uint32_t uintptr_t;
+//
+// XCORE:typedef long long int intmax_t;
+// XCORE:typedef long long unsigned int uintmax_t;
+//
+// XCORE:INT8_MAX_ 127
+// XCORE:INT8_MIN_ (-127 -1)
+// XCORE:UINT8_MAX_ 255
+// XCORE:INT_LEAST8_MIN_ (-127 -1)
+// XCORE:INT_LEAST8_MAX_ 127
+// XCORE:UINT_LEAST8_MAX_ 255
+// XCORE:INT_FAST8_MIN_ (-127 -1)
+// XCORE:INT_FAST8_MAX_ 127
+// XCORE:UINT_FAST8_MAX_ 255
+//
+// XCORE:INT16_MAX_ 32767
+// XCORE:INT16_MIN_ (-32767 -1)
+// XCORE:UINT16_MAX_ 65535
+// XCORE:INT_LEAST16_MIN_ (-32767 -1)
+// XCORE:INT_LEAST16_MAX_ 32767
+// XCORE:UINT_LEAST16_MAX_ 65535
+// XCORE:INT_FAST16_MIN_ (-32767 -1)
+// XCORE:INT_FAST16_MAX_ 32767
+// XCORE:UINT_FAST16_MAX_ 65535
+//
+// XCORE:INT32_MAX_ 2147483647
+// XCORE:INT32_MIN_ (-2147483647 -1)
+// XCORE:UINT32_MAX_ 4294967295U
+// XCORE:INT_LEAST32_MIN_ (-2147483647 -1)
+// XCORE:INT_LEAST32_MAX_ 2147483647
+// XCORE:UINT_LEAST32_MAX_ 4294967295U
+// XCORE:INT_FAST32_MIN_ (-2147483647 -1)
+// XCORE:INT_FAST32_MAX_ 2147483647
+// XCORE:UINT_FAST32_MAX_ 4294967295U
+//
+// XCORE:INT64_MAX_ 9223372036854775807LL
+// XCORE:INT64_MIN_ (-9223372036854775807LL -1)
+// XCORE:UINT64_MAX_ 18446744073709551615ULL
+// XCORE:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
+// XCORE:INT_LEAST64_MAX_ 9223372036854775807LL
+// XCORE:UINT_LEAST64_MAX_ 18446744073709551615ULL
+// XCORE:INT_FAST64_MIN_ (-9223372036854775807LL -1)
+// XCORE:INT_FAST64_MAX_ 9223372036854775807LL
+// XCORE:UINT_FAST64_MAX_ 18446744073709551615ULL
+//
+// XCORE:INTPTR_MIN_ (-2147483647 -1)
+// XCORE:INTPTR_MAX_ 2147483647
+// XCORE:UINTPTR_MAX_ 4294967295U
+// XCORE:PTRDIFF_MIN_ (-2147483647 -1)
+// XCORE:PTRDIFF_MAX_ 2147483647
+// XCORE:SIZE_MAX_ 4294967295U
+//
+// XCORE:INTMAX_MIN_ (-9223372036854775807LL -1)
+// XCORE:INTMAX_MAX_ 9223372036854775807LL
+// XCORE:UINTMAX_MAX_ 18446744073709551615ULL
+//
+// XCORE:SIG_ATOMIC_MIN_ (-2147483647 -1)
+// XCORE:SIG_ATOMIC_MAX_ 2147483647
+// XCORE:WINT_MIN_ 0U
+// XCORE:WINT_MAX_ 4294967295U
+//
+// XCORE:WCHAR_MAX_ 255U
+// XCORE:WCHAR_MIN_ 0
+//
+// XCORE:INT8_C_(0) 0
+// XCORE:UINT8_C_(0) 0U
+// XCORE:INT16_C_(0) 0
+// XCORE:UINT16_C_(0) 0U
+// XCORE:INT32_C_(0) 0
+// XCORE:UINT32_C_(0) 0U
+// XCORE:INT64_C_(0) 0LL
+// XCORE:UINT64_C_(0) 0ULL
+//
+// XCORE:INTMAX_C_(0) 0LL
+// XCORE:UINTMAX_C_(0) 0ULL
+//
+//
// stdint.h forms several macro definitions by pasting together identifiers
// to form names (eg. int32_t is formed from int ## 32 ## _t). The following
// case tests that these joining operations are performed correctly even if
OpenPOWER on IntegriCloud