168 changes: 168 additions & 0 deletions clang/lib/Headers/stdint.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,18 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT64_MAX INT64_C( 9223372036854775807)
# define INT64_MIN (-INT64_C( 9223372036854775807)-1)
# define UINT64_MAX UINT64_C(18446744073709551615)
/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT64_WIDTH 64
# define INT64_WIDTH UINT64_WIDTH

# define __UINT_LEAST64_WIDTH UINT64_WIDTH
# define __UINT_LEAST32_WIDTH UINT64_WIDTH
# define __UINT_LEAST16_WIDTH UINT64_WIDTH
# define __UINT_LEAST8_MAX UINT64_MAX
#endif /* __STDC_VERSION__ */

# define __INT_LEAST64_MIN INT64_MIN
# define __INT_LEAST64_MAX INT64_MAX
# define __UINT_LEAST64_MAX UINT64_MAX
Expand All @@ -482,6 +494,15 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT_FAST64_MIN __INT_LEAST64_MIN
# define INT_FAST64_MAX __INT_LEAST64_MAX
# define UINT_FAST64_MAX __UINT_LEAST64_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT_LEAST64_WIDTH __UINT_LEAST64_WIDTH
# define INT_LEAST64_WIDTH UINT_LEAST64_WIDTH
# define UINT_FAST64_WIDTH __UINT_LEAST64_WIDTH
# define INT_FAST64_WIDTH UINT_FAST64_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT_LEAST64_MIN */


Expand All @@ -495,6 +516,7 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT_FAST56_MIN INT56_MIN
# define INT_FAST56_MAX INT56_MAX
# define UINT_FAST56_MAX UINT56_MAX

# define __INT_LEAST32_MIN INT56_MIN
# define __INT_LEAST32_MAX INT56_MAX
# define __UINT_LEAST32_MAX UINT56_MAX
Expand All @@ -504,6 +526,20 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define __INT_LEAST8_MIN INT56_MIN
# define __INT_LEAST8_MAX INT56_MAX
# define __UINT_LEAST8_MAX UINT56_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT56_WIDTH 56
# define INT56_WIDTH UINT56_WIDTH
# define UINT_LEAST56_WIDTH UINT56_WIDTH
# define INT_LEAST56_WIDTH UINT_LEAST56_WIDTH
# define UINT_FAST56_WIDTH UINT56_WIDTH
# define INT_FAST56_WIDTH UINT_FAST56_WIDTH
# define __UINT_LEAST32_WIDTH UINT56_WIDTH
# define __UINT_LEAST16_WIDTH UINT56_WIDTH
# define __UINT_LEAST8_WIDTH UINT56_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT56_TYPE__ */


Expand All @@ -517,6 +553,7 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT_FAST48_MIN INT48_MIN
# define INT_FAST48_MAX INT48_MAX
# define UINT_FAST48_MAX UINT48_MAX

# define __INT_LEAST32_MIN INT48_MIN
# define __INT_LEAST32_MAX INT48_MAX
# define __UINT_LEAST32_MAX UINT48_MAX
Expand All @@ -526,6 +563,20 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define __INT_LEAST8_MIN INT48_MIN
# define __INT_LEAST8_MAX INT48_MAX
# define __UINT_LEAST8_MAX UINT48_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
#define UINT48_WIDTH 48
#define INT48_WIDTH UINT48_WIDTH
#define UINT_LEAST48_WIDTH UINT48_WIDTH
#define INT_LEAST48_WIDTH UINT_LEAST48_WIDTH
#define UINT_FAST48_WIDTH UINT48_WIDTH
#define INT_FAST48_WIDTH UINT_FAST48_WIDTH
#define __UINT_LEAST32_WIDTH UINT48_WIDTH
#define __UINT_LEAST16_WIDTH UINT48_WIDTH
#define __UINT_LEAST8_WIDTH UINT48_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT48_TYPE__ */


Expand All @@ -539,6 +590,7 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT_FAST40_MIN INT40_MIN
# define INT_FAST40_MAX INT40_MAX
# define UINT_FAST40_MAX UINT40_MAX

# define __INT_LEAST32_MIN INT40_MIN
# define __INT_LEAST32_MAX INT40_MAX
# define __UINT_LEAST32_MAX UINT40_MAX
Expand All @@ -548,13 +600,28 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define __INT_LEAST8_MIN INT40_MIN
# define __INT_LEAST8_MAX INT40_MAX
# define __UINT_LEAST8_MAX UINT40_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT40_WIDTH 40
# define INT40_WIDTH UINT40_WIDTH
# define UINT_LEAST40_WIDTH UINT40_WIDTH
# define INT_LEAST40_WIDTH UINT_LEAST40_WIDTH
# define UINT_FAST40_WIDTH UINT40_WIDTH
# define INT_FAST40_WIDTH UINT_FAST40_WIDTH
# define __UINT_LEAST32_WIDTH UINT40_WIDTH
# define __UINT_LEAST16_WIDTH UINT40_WIDTH
# define __UINT_LEAST8_WIDTH UINT40_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT40_TYPE__ */


#ifdef __INT32_TYPE__
# define INT32_MAX INT32_C(2147483647)
# define INT32_MIN (-INT32_C(2147483647)-1)
# define UINT32_MAX UINT32_C(4294967295)

# define __INT_LEAST32_MIN INT32_MIN
# define __INT_LEAST32_MAX INT32_MAX
# define __UINT_LEAST32_MAX UINT32_MAX
Expand All @@ -564,6 +631,16 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define __INT_LEAST8_MIN INT32_MIN
# define __INT_LEAST8_MAX INT32_MAX
# define __UINT_LEAST8_MAX UINT32_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT32_WIDTH 32
# define INT32_WIDTH UINT32_WIDTH
# define __UINT_LEAST32_WIDTH UINT32_WIDTH
# define __UINT_LEAST16_WIDTH UINT32_WIDTH
# define __UINT_LEAST8_WIDTH UINT32_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT32_TYPE__ */

#ifdef __INT_LEAST32_MIN
Expand All @@ -573,6 +650,15 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT_FAST32_MIN __INT_LEAST32_MIN
# define INT_FAST32_MAX __INT_LEAST32_MAX
# define UINT_FAST32_MAX __UINT_LEAST32_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT_LEAST32_WIDTH __UINT_LEAST32_WIDTH
# define INT_LEAST32_WIDTH UINT_LEAST32_WIDTH
# define UINT_FAST32_WIDTH __UINT_LEAST32_WIDTH
# define INT_FAST32_WIDTH UINT_FAST32_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT_LEAST32_MIN */


Expand All @@ -586,25 +672,49 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT_FAST24_MIN INT24_MIN
# define INT_FAST24_MAX INT24_MAX
# define UINT_FAST24_MAX UINT24_MAX

# define __INT_LEAST16_MIN INT24_MIN
# define __INT_LEAST16_MAX INT24_MAX
# define __UINT_LEAST16_MAX UINT24_MAX
# define __INT_LEAST8_MIN INT24_MIN
# define __INT_LEAST8_MAX INT24_MAX
# define __UINT_LEAST8_MAX UINT24_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT24_WIDTH 24
# define INT24_WIDTH UINT24_WIDTH
# define UINT_LEAST24_WIDTH UINT24_WIDTH
# define INT_LEAST24_WIDTH UINT_LEAST24_WIDTH
# define UINT_FAST24_WIDTH UINT24_WIDTH
# define INT_FAST24_WIDTH UINT_FAST24_WIDTH
# define __UINT_LEAST16_WIDTH UINT24_WIDTH
# define __UINT_LEAST8_WIDTH UINT24_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT24_TYPE__ */


#ifdef __INT16_TYPE__
#define INT16_MAX INT16_C(32767)
#define INT16_MIN (-INT16_C(32767)-1)
#define UINT16_MAX UINT16_C(65535)

# define __INT_LEAST16_MIN INT16_MIN
# define __INT_LEAST16_MAX INT16_MAX
# define __UINT_LEAST16_MAX UINT16_MAX
# define __INT_LEAST8_MIN INT16_MIN
# define __INT_LEAST8_MAX INT16_MAX
# define __UINT_LEAST8_MAX UINT16_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT16_WIDTH 16
# define INT16_WIDTH UINT16_WIDTH
# define __UINT_LEAST16_WIDTH UINT16_WIDTH
# define __UINT_LEAST8_WIDTH UINT16_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT16_TYPE__ */

#ifdef __INT_LEAST16_MIN
Expand All @@ -614,16 +724,34 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT_FAST16_MIN __INT_LEAST16_MIN
# define INT_FAST16_MAX __INT_LEAST16_MAX
# define UINT_FAST16_MAX __UINT_LEAST16_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT_LEAST16_WIDTH __UINT_LEAST16_WIDTH
# define INT_LEAST16_WIDTH UINT_LEAST16_WIDTH
# define UINT_FAST16_WIDTH __UINT_LEAST16_WIDTH
# define INT_FAST16_WIDTH UINT_FAST16_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT_LEAST16_MIN */


#ifdef __INT8_TYPE__
# define INT8_MAX INT8_C(127)
# define INT8_MIN (-INT8_C(127)-1)
# define UINT8_MAX UINT8_C(255)

# define __INT_LEAST8_MIN INT8_MIN
# define __INT_LEAST8_MAX INT8_MAX
# define __UINT_LEAST8_MAX UINT8_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT8_WIDTH 8
# define INT8_WIDTH UINT8_WIDTH
# define __UINT_LEAST8_WIDTH UINT8_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT8_TYPE__ */

#ifdef __INT_LEAST8_MIN
Expand All @@ -633,6 +761,15 @@ typedef __UINTMAX_TYPE__ uintmax_t;
# define INT_FAST8_MIN __INT_LEAST8_MIN
# define INT_FAST8_MAX __INT_LEAST8_MAX
# define UINT_FAST8_MAX __UINT_LEAST8_MAX

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
# define UINT_LEAST8_WIDTH __UINT_LEAST8_WIDTH
# define INT_LEAST8_WIDTH UINT_LEAST8_WIDTH
# define UINT_FAST8_WIDTH __UINT_LEAST8_WIDTH
# define INT_FAST8_WIDTH UINT_FAST8_WIDTH
#endif /* __STDC_VERSION__ */
#endif /* __INT_LEAST8_MIN */

/* Some utility macros */
Expand All @@ -652,6 +789,16 @@ typedef __UINTMAX_TYPE__ uintmax_t;
#define PTRDIFF_MAX __PTRDIFF_MAX__
#define SIZE_MAX __SIZE_MAX__

/* C2x 7.20.2.4 Width of integer types capable of holding object pointers. */
/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
/* NB: The C standard requires that these be the same value, but the compiler
exposes separate internal width macros. */
#define INTPTR_WIDTH __INTPTR_WIDTH__
#define UINTPTR_WIDTH __UINTPTR_WIDTH__
#endif

/* ISO9899:2011 7.20 (C11 Annex K): Define RSIZE_MAX if __STDC_WANT_LIB_EXT1__
* is enabled. */
#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
Expand All @@ -663,6 +810,16 @@ typedef __UINTMAX_TYPE__ uintmax_t;
#define INTMAX_MAX __INTMAX_MAX__
#define UINTMAX_MAX __UINTMAX_MAX__

/* C2x 7.20.2.5 Width of greatest-width integer types. */
/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
/* NB: The C standard requires that these be the same value, but the compiler
exposes separate internal width macros. */
#define INTMAX_WIDTH __INTMAX_WIDTH__
#define UINTMAX_WIDTH __UINTMAX_WIDTH__
#endif

/* C99 7.18.3 Limits of other integer types. */
#define SIG_ATOMIC_MIN __INTN_MIN(__SIG_ATOMIC_WIDTH__)
#define SIG_ATOMIC_MAX __INTN_MAX(__SIG_ATOMIC_WIDTH__)
Expand All @@ -689,5 +846,16 @@ typedef __UINTMAX_TYPE__ uintmax_t;
#define INTMAX_C(v) __int_c(v, __INTMAX_C_SUFFIX__)
#define UINTMAX_C(v) __int_c(v, __UINTMAX_C_SUFFIX__)

/* C2x 7.20.3.x Width of other integer types. */
/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
#define PTRDIFF_WIDTH __PTRDIFF_WIDTH__
#define SIG_ATOMIC_WIDTH __SIG_ATOMIC_WIDTH__
#define SIZE_WIDTH __SIZE_WIDTH__
#define WCHAR_WIDTH __WCHAR_WIDTH__
#define WINT_WIDTH __WINT_WIDTH__
#endif

#endif /* __STDC_HOSTED__ */
#endif /* __CLANG_STDINT_H */
45 changes: 42 additions & 3 deletions clang/test/Headers/limits.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify %s
// RUN: %clang_cc1 -fno-signed-char -ffreestanding -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++11 -ffreestanding -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c17 -ffreestanding -fsyntax-only -verify -x c %s
// RUN: %clang_cc1 -std=c2x -ffreestanding -fsyntax-only -verify -x c %s
// expected-no-diagnostics

#include <limits.h>
Expand Down Expand Up @@ -29,9 +31,8 @@ _Static_assert(MB_LEN_MAX >= 1, "");

_Static_assert(CHAR_BIT >= 8, "");

const bool char_is_signed = (char)-1 < (char)0;
_Static_assert(CHAR_MIN == (char_is_signed ? -CHAR_MAX-1 : 0), "");
_Static_assert(CHAR_MAX == (char_is_signed ? -(CHAR_MIN+1) : (char)~0ULL), "");
_Static_assert(CHAR_MIN == (((char)-1 < (char)0) ? -CHAR_MAX-1 : 0), "");
_Static_assert(CHAR_MAX == (((char)-1 < (char)0) ? -(CHAR_MIN+1) : (char)~0ULL), "");

#if __STDC_VERSION__ >= 199901 || __cplusplus >= 201103L
_Static_assert(LLONG_MAX == -(LLONG_MIN+1LL), "");
Expand All @@ -40,3 +41,41 @@ _Static_assert(ULLONG_MAX == (unsigned long long)~0ULL, "");
#else
int LLONG_MIN, LLONG_MAX, ULLONG_MAX; // Not defined.
#endif

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
/* Validate the standard requirements. */
_Static_assert(BOOL_WIDTH >= 1);

_Static_assert(CHAR_WIDTH == CHAR_BIT);
_Static_assert(CHAR_WIDTH / CHAR_BIT == sizeof(char));
_Static_assert(SCHAR_WIDTH == CHAR_BIT);
_Static_assert(SCHAR_WIDTH / CHAR_BIT == sizeof(signed char));
_Static_assert(UCHAR_WIDTH == CHAR_BIT);
_Static_assert(UCHAR_WIDTH / CHAR_BIT == sizeof(unsigned char));

_Static_assert(USHRT_WIDTH >= 16);
_Static_assert(USHRT_WIDTH / CHAR_BIT == sizeof(unsigned short));
_Static_assert(SHRT_WIDTH == USHRT_WIDTH);
_Static_assert(SHRT_WIDTH / CHAR_BIT == sizeof(signed short));

_Static_assert(UINT_WIDTH >= 16);
_Static_assert(UINT_WIDTH / CHAR_BIT == sizeof(unsigned int));
_Static_assert(INT_WIDTH == UINT_WIDTH);
_Static_assert(INT_WIDTH / CHAR_BIT == sizeof(signed int));

_Static_assert(ULONG_WIDTH >= 32);
_Static_assert(ULONG_WIDTH / CHAR_BIT == sizeof(unsigned long));
_Static_assert(LONG_WIDTH == ULONG_WIDTH);
_Static_assert(LONG_WIDTH / CHAR_BIT == sizeof(signed long));

_Static_assert(ULLONG_WIDTH >= 64);
_Static_assert(ULLONG_WIDTH / CHAR_BIT == sizeof(unsigned long long));
_Static_assert(LLONG_WIDTH == ULLONG_WIDTH);
_Static_assert(LLONG_WIDTH / CHAR_BIT == sizeof(signed long long));
#else
/* None of these are defined. */
int BOOL_WIDTH, CHAR_WIDTH, SCHAR_WIDTH, UCHAR_WIDTH, USHRT_WIDTH, SHRT_WIDTH,
UINT_WIDTH, INT_WIDTH, ULONG_WIDTH, LONG_WIDTH, ULLONG_WIDTH, LLONG_WIDTH;
#endif
253 changes: 253 additions & 0 deletions clang/test/Headers/stdint.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify -std=c17 %s
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify -std=c2x %s
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=aarch64-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=arm-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=i386-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=mips-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=mips64-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=msp430-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=powerpc64-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=powerpc64-none-netbsd
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=powerpc-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=s390x-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=sparc-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=tce-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=x86_64-none-none
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=x86_64-pc-linux-gnu
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=i386-mingw32
// RUN: %clang_cc1 %s -ffreestanding -std=c2x -fsyntax-only -triple=xcore-none-none
// expected-no-diagnostics

#include <stdint.h>

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if __STDC_VERSION__ >= 202000L
/* Validate the standard requirements. */
_Static_assert(SIG_ATOMIC_WIDTH >= 8);
_Static_assert(SIZE_WIDTH >= 16);
_Static_assert(SIZE_WIDTH / __CHAR_BIT__ == sizeof(sizeof(0)));
_Static_assert(WCHAR_WIDTH >= 8);
_Static_assert(WCHAR_WIDTH / __CHAR_BIT__ == sizeof(L't'));
_Static_assert(WINT_WIDTH >= 16);
_Static_assert(UINTPTR_WIDTH >= 16);
_Static_assert(UINTPTR_WIDTH / __CHAR_BIT__ == sizeof(uintptr_t));
_Static_assert(INTPTR_WIDTH == UINTPTR_WIDTH);
_Static_assert(INTPTR_WIDTH / __CHAR_BIT__ == sizeof(intptr_t));

/* FIXME: the TCE target is not a conforming C target because it defines these
values to be less than 64. */
#if !defined(__TCE__)
_Static_assert(UINTMAX_WIDTH >= 64);
_Static_assert(UINTMAX_WIDTH / __CHAR_BIT__ == sizeof(uintmax_t));
_Static_assert(INTMAX_WIDTH == UINTMAX_WIDTH);
_Static_assert(INTMAX_WIDTH / __CHAR_BIT__ == sizeof(intmax_t));
#endif

/* NB: WG14 N2412 set this to 17, but WG14 N2808 set it back to 16. */
_Static_assert(PTRDIFF_WIDTH >= 16);
#else
/* None of these are defined. */
int PTRDIFF_WIDTH, SIG_ATOMIC_WIDTH, SIZE_WIDTH, WCHAR_WIDTH, WINT_WIDTH,
INTPTR_WIDTH, UINTPTR_WIDTH, INTMAX_WIDTH, UINTMAX_WIDTH;
#endif

#if defined(INT8_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT8_WIDTH == 8, "");
_Static_assert(UINT8_WIDTH == INT8_WIDTH, "");
_Static_assert(INT8_WIDTH / __CHAR_BIT__ == sizeof(int8_t), "");
_Static_assert(UINT8_WIDTH / __CHAR_BIT__ == sizeof(uint8_t), "");
#else
int INT8_WIDTH, UINT8_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_LEAST8_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_LEAST8_WIDTH >= 8, "");
_Static_assert(INT_LEAST8_WIDTH / __CHAR_BIT__ == sizeof(int_least8_t), "");
_Static_assert(UINT_LEAST8_WIDTH == INT_LEAST8_WIDTH, "");
_Static_assert(UINT_LEAST8_WIDTH / __CHAR_BIT__ == sizeof(uint_least8_t), "");
#else
int INT_LEAST8_WIDTH, UINT_LEAST8_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_FAST8_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_FAST8_WIDTH >= 8, "");
_Static_assert(INT_FAST8_WIDTH / __CHAR_BIT__ == sizeof(int_fast8_t), "");
_Static_assert(UINT_FAST8_WIDTH == INT_FAST8_WIDTH, "");
_Static_assert(UINT_FAST8_WIDTH / __CHAR_BIT__ == sizeof(uint_fast8_t), "");
#else
int INT_FAST8_WIDTH, UINT_FAST8_WIDTH; /* None of these are defined. */
#endif

#if defined(INT16_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT16_WIDTH == 16, "");
_Static_assert(UINT16_WIDTH == INT16_WIDTH, "");
_Static_assert(INT16_WIDTH / __CHAR_BIT__ == sizeof(int16_t), "");
_Static_assert(UINT16_WIDTH / __CHAR_BIT__ == sizeof(uint16_t), "");
#else
int INT16_WIDTH, UINT16_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_LEAST16_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_LEAST16_WIDTH >= 16, "");
_Static_assert(INT_LEAST16_WIDTH / __CHAR_BIT__ == sizeof(int_least16_t), "");
_Static_assert(UINT_LEAST16_WIDTH == INT_LEAST16_WIDTH, "");
_Static_assert(UINT_LEAST16_WIDTH / __CHAR_BIT__ == sizeof(uint_least16_t), "");
#else
int INT_LEAST16_WIDTH, UINT_LEAST16_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_FAST16_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_FAST16_WIDTH >= 16, "");
_Static_assert(INT_FAST16_WIDTH / __CHAR_BIT__ == sizeof(int_fast16_t), "");
_Static_assert(UINT_FAST16_WIDTH == INT_FAST16_WIDTH, "");
_Static_assert(UINT_FAST16_WIDTH / __CHAR_BIT__ == sizeof(int_fast16_t), "");
#else
int INT_FAST16_WIDTH, UINT_FAST16_WIDTH; /* None of these are defined. */
#endif

#if defined(INT24_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT24_WIDTH == 24, "");
_Static_assert(UINT24_WIDTH == INT24_WIDTH, "");
_Static_assert(INT24_WIDTH / __CHAR_BIT__ == sizeof(int24_t), "");
_Static_assert(UINT24_WIDTH / __CHAR_BIT__ == sizeof(uint24_t), "");
#else
int INT24_WIDTH, UINT24_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_LEAST24_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_LEAST24_WIDTH >= 24, "");
_Static_assert(INT_LEAST24_WIDTH / __CHAR_BIT__ == sizeof(int_least24_t), "");
_Static_assert(UINT_LEAST24_WIDTH == INT_LEAST24_WIDTH, "");
_Static_assert(UINT_LEAST24_WIDTH / __CHAR_BIT__ == sizeof(uint_least24_t), "");
#else
int INT_LEAST24_WIDTH, UINT_LEAST24_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_FAST24_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_FAST24_WIDTH >= 24, "");
_Static_assert(INT_FAST24_WIDTH / __CHAR_BIT__ == sizeof(int_fast24_t), "");
_Static_assert(UINT_FAST24_WIDTH == INT_FAST24_WIDTH, "");
_Static_assert(UINT_FAST24_WIDTH / __CHAR_BIT__ == sizeof(uint_fast24_t), "");
#else
int INT_FAST24_WIDTH, UINT_FAST24_WIDTH; /* None of these are defined. */
#endif

#if defined(INT32_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT32_WIDTH == 32, "");
_Static_assert(UINT32_WIDTH == INT32_WIDTH, "");
_Static_assert(INT32_WIDTH / __CHAR_BIT__ == sizeof(int32_t), "");
_Static_assert(UINT32_WIDTH / __CHAR_BIT__ == sizeof(uint32_t), "");
#else
int INT32_WIDTH, UINT32_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_LEAST32_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_LEAST32_WIDTH >= 32, "");
_Static_assert(INT_LEAST32_WIDTH / __CHAR_BIT__ == sizeof(int_least32_t), "");
_Static_assert(UINT_LEAST32_WIDTH == INT_LEAST32_WIDTH, "");
_Static_assert(UINT_LEAST32_WIDTH / __CHAR_BIT__ == sizeof(uint_least32_t), "");
#else
int INT_LEAST32_WIDTH, UINT_LEAST32_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_FAST32_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_FAST32_WIDTH >= 32, "");
_Static_assert(INT_FAST32_WIDTH / __CHAR_BIT__ == sizeof(int_fast32_t), "");
_Static_assert(UINT_FAST32_WIDTH == INT_FAST32_WIDTH, "");
_Static_assert(UINT_FAST32_WIDTH / __CHAR_BIT__ == sizeof(uint_fast32_t), "");
#else
int INT_FAST32_WIDTH, UINT_FAST32_WIDTH; /* None of these are defined. */
#endif

#if defined(INT40_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT40_WIDTH == 40, "");
_Static_assert(UINT40_WIDTH == INT40_WIDTH, "");
_Static_assert(INT40_WIDTH / __CHAR_BIT__ == sizeof(int40_t), "");
_Static_assert(UINT40_WIDTH / __CHAR_BIT__ == sizeof(uint40_t), "");
#else
int INT40_WIDTH, UINT40_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_LEAST40_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_LEAST40_WIDTH >= 40, "");
_Static_assert(INT_LEAST40_WIDTH / __CHAR_BIT__ == sizeof(int_least40_t), "");
_Static_assert(UINT_LEAST40_WIDTH == INT_LEAST40_WIDTH, "");
_Static_assert(UINT_LEAST40_WIDTH / __CHAR_BIT__ == sizeof(int_least40_t), "");
#else
int INT_LEAST40_WIDTH, UINT_LEAST40_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_FAST40_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_FAST40_WIDTH >= 40, "");
_Static_assert(INT_FAST40_WIDTH / __CHAR_BIT__ == sizeof(int_fast40_t), "");
_Static_assert(UINT_FAST40_WIDTH == INT_FAST40_WIDTH, "");
_Static_assert(UINT_FAST40_WIDTH / __CHAR_BIT__ == sizeof(uint_fast40_t), "");
#else
int INT_FAST40_WIDTH, UINT_FAST40_WIDTH; /* None of these are defined. */
#endif

#if defined(INT48_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT48_WIDTH == 48, "");
_Static_assert(UINT48_WIDTH == INT48_WIDTH, "");
_Static_assert(INT48_WIDTH / __CHAR_BIT__ == sizeof(int48_t), "");
_Static_assert(UINT48_WIDTH / __CHAR_BIT__ == sizeof(uint48_t), "");
#else
int INT48_WIDTH, UINT48_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_LEAST48_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_LEAST48_WIDTH >= 48, "");
_Static_assert(INT_LEAST48_WIDTH / __CHAR_BIT__ == sizeof(int_least48_t), "");
_Static_assert(UINT_LEAST48_WIDTH == INT_LEAST48_WIDTH, "");
_Static_assert(UINT_LEAST48_WIDTH / __CHAR_BIT__ == sizeof(int_least48_t), "");
#else
int INT_LEAST48_WIDTH, UINT_LEAST48_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_FAST48_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_FAST48_WIDTH >= 48, "");
_Static_assert(INT_FAST48_WIDTH / __CHAR_BIT__ == sizeof(int_fast48_t), "");
_Static_assert(UINT_FAST48_WIDTH == INT_FAST48_WIDTH, "");
_Static_assert(UINT_FAST48_WIDTH / __CHAR_BIT__ == sizeof(int_fast48_t), "");
#else
int INT_FAST48_WIDTH, UINT_FAST48_WIDTH; /* None of these are defined. */
#endif

#if defined(INT56_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT56_WIDTH == 56, "");
_Static_assert(UINT56_WIDTH == INT56_WIDTH, "");
_Static_assert(INT56_WIDTH / __CHAR_BIT__ == sizeof(int56_t), "");
_Static_assert(UINT56_WIDTH / __CHAR_BIT__ == sizeof(uint56_t), "");
#else
int INT56_WIDTH, UINT56_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_LEAST56_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_LEAST56_WIDTH >= 56, "");
_Static_assert(INT_LEAST56_WIDTH / __CHAR_BIT__ == sizeof(int_least56_t), "");
_Static_assert(UINT_LEAST56_WIDTH == INT_LEAST56_WIDTH, "");
_Static_assert(UINT_LEAST56_WIDTH / __CHAR_BIT__ == sizeof(int_least56_t), "");
#else
int INT_LEAST56_WIDTH, UINT_LEAST56_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_FAST56_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_FAST56_WIDTH >= 56, "");
_Static_assert(INT_FAST56_WIDTH / __CHAR_BIT__ == sizeof(int_fast56_t), "");
_Static_assert(UINT_FAST56_WIDTH == INT_FAST56_WIDTH, "");
_Static_assert(UINT_FAST56_WIDTH / __CHAR_BIT__ == sizeof(int_fast56_t), "");
#else
int INT_FAST56_WIDTH, UINT_FAST56_WIDTH; /* None of these are defined. */
#endif

#if defined(INT64_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT64_WIDTH == 64, "");
_Static_assert(UINT64_WIDTH == INT64_WIDTH, "");
_Static_assert(INT64_WIDTH / __CHAR_BIT__ == sizeof(int64_t), "");
_Static_assert(UINT64_WIDTH / __CHAR_BIT__ == sizeof(uint64_t), "");
#else
int INT64_WIDTH, UINT64_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_LEAST64_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_LEAST64_WIDTH >= 64, "");
_Static_assert(INT_LEAST64_WIDTH / __CHAR_BIT__ == sizeof(int_least64_t), "");
_Static_assert(UINT_LEAST64_WIDTH == INT_LEAST64_WIDTH, "");
_Static_assert(UINT_LEAST64_WIDTH / __CHAR_BIT__ == sizeof(int_least64_t), "");
#else
int INT_LEAST64_WIDTH, UINT_LEAST64_WIDTH; /* None of these are defined. */
#endif
#if defined(INT_FAST64_MAX) && __STDC_VERSION__ >= 202000L
_Static_assert(INT_FAST64_WIDTH >= 64, "");
_Static_assert(INT_FAST64_WIDTH / __CHAR_BIT__ == sizeof(int_fast64_t), "");
_Static_assert(UINT_FAST64_WIDTH == INT_FAST64_WIDTH, "");
_Static_assert(UINT_FAST64_WIDTH / __CHAR_BIT__ == sizeof(int_fast64_t), "");
#else
int INT_FAST64_WIDTH, UINT_FAST64_WIDTH; /* None of these are defined. */
#endif
13 changes: 13 additions & 0 deletions clang/test/Preprocessor/init-aarch64.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
// AARCH64-NEXT: #define __ATOMIC_SEQ_CST 5
// AARCH64: #define __BIGGEST_ALIGNMENT__ 16
// AARCH64_BE-NEXT: #define __BIG_ENDIAN__ 1
// AARCH64-NEXT: #define __BOOL_WIDTH__ 8
// AARCH64_BE-NEXT: #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// AARCH64_LE-NEXT: #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// AARCH64-NEXT: #define __CHAR16_TYPE__ unsigned short
Expand Down Expand Up @@ -144,35 +145,44 @@
// AARCH64-NEXT: #define __INT_FAST16_FMTi__ "hi"
// AARCH64-NEXT: #define __INT_FAST16_MAX__ 32767
// AARCH64-NEXT: #define __INT_FAST16_TYPE__ short
// AARCH64-NEXT: #define __INT_FAST16_WIDTH__ 16
// AARCH64-NEXT: #define __INT_FAST32_FMTd__ "d"
// AARCH64-NEXT: #define __INT_FAST32_FMTi__ "i"
// AARCH64-NEXT: #define __INT_FAST32_MAX__ 2147483647
// AARCH64-NEXT: #define __INT_FAST32_TYPE__ int
// AARCH64-NEXT: #define __INT_FAST32_WIDTH__ 32
// AARCH64-NEXT: #define __INT_FAST64_FMTd__ "ld"
// AARCH64-NEXT: #define __INT_FAST64_FMTi__ "li"
// AARCH64-NEXT: #define __INT_FAST64_MAX__ 9223372036854775807L
// AARCH64-NEXT: #define __INT_FAST64_TYPE__ long int
// AARCH64-NEXT: #define __INT_FAST64_WIDTH__ 64
// AARCH64-NEXT: #define __INT_FAST8_FMTd__ "hhd"
// AARCH64-NEXT: #define __INT_FAST8_FMTi__ "hhi"
// AARCH64-NEXT: #define __INT_FAST8_MAX__ 127
// AARCH64-NEXT: #define __INT_FAST8_TYPE__ signed char
// AARCH64-NEXT: #define __INT_FAST8_WIDTH__ 8
// AARCH64-NEXT: #define __INT_LEAST16_FMTd__ "hd"
// AARCH64-NEXT: #define __INT_LEAST16_FMTi__ "hi"
// AARCH64-NEXT: #define __INT_LEAST16_MAX__ 32767
// AARCH64-NEXT: #define __INT_LEAST16_TYPE__ short
// AARCH64-NEXT: #define __INT_LEAST16_WIDTH__ 16
// AARCH64-NEXT: #define __INT_LEAST32_FMTd__ "d"
// AARCH64-NEXT: #define __INT_LEAST32_FMTi__ "i"
// AARCH64-NEXT: #define __INT_LEAST32_MAX__ 2147483647
// AARCH64-NEXT: #define __INT_LEAST32_TYPE__ int
// AARCH64-NEXT: #define __INT_LEAST32_WIDTH__ 32
// AARCH64-NEXT: #define __INT_LEAST64_FMTd__ "ld"
// AARCH64-NEXT: #define __INT_LEAST64_FMTi__ "li"
// AARCH64-NEXT: #define __INT_LEAST64_MAX__ 9223372036854775807L
// AARCH64-NEXT: #define __INT_LEAST64_TYPE__ long int
// AARCH64-NEXT: #define __INT_LEAST64_WIDTH__ 64
// AARCH64-NEXT: #define __INT_LEAST8_FMTd__ "hhd"
// AARCH64-NEXT: #define __INT_LEAST8_FMTi__ "hhi"
// AARCH64-NEXT: #define __INT_LEAST8_MAX__ 127
// AARCH64-NEXT: #define __INT_LEAST8_TYPE__ signed char
// AARCH64-NEXT: #define __INT_LEAST8_WIDTH__ 8
// AARCH64-NEXT: #define __INT_MAX__ 2147483647
// AARCH64-NEXT: #define __INT_WIDTH__ 32
// AARCH64-NEXT: #define __LDBL_DECIMAL_DIG__ 36
// AARCH64-NEXT: #define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
// AARCH64-NEXT: #define __LDBL_DIG__ 33
Expand All @@ -188,8 +198,10 @@
// AARCH64-NEXT: #define __LDBL_MIN_EXP__ (-16381)
// AARCH64-NEXT: #define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
// AARCH64_LE-NEXT: #define __LITTLE_ENDIAN__ 1
// AARCH64-NEXT: #define __LLONG_WIDTH__ 64
// AARCH64-NEXT: #define __LONG_LONG_MAX__ 9223372036854775807LL
// AARCH64-NEXT: #define __LONG_MAX__ 9223372036854775807L
// AARCH64-NEXT: #define __LONG_WIDTH__ 64
// AARCH64-NEXT: #define __LP64__ 1
// AARCH64-NEXT: #define __NO_INLINE__ 1
// AARCH64-NEXT: #define __NO_MATH_ERRNO__ 1
Expand All @@ -211,6 +223,7 @@
// AARCH64-NEXT: #define __PTRDIFF_WIDTH__ 64
// AARCH64-NEXT: #define __SCHAR_MAX__ 127
// AARCH64-NEXT: #define __SHRT_MAX__ 32767
// AARCH64-NEXT: #define __SHRT_WIDTH__ 16
// AARCH64-NEXT: #define __SIG_ATOMIC_MAX__ 2147483647
// AARCH64-NEXT: #define __SIG_ATOMIC_WIDTH__ 32
// AARCH64-NEXT: #define __SIZEOF_DOUBLE__ 8
Expand Down
14 changes: 14 additions & 0 deletions clang/test/Preprocessor/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,7 @@
// WEBASSEMBLY-NEXT:#define __ATOMIC_RELEASE 3
// WEBASSEMBLY-NEXT:#define __ATOMIC_SEQ_CST 5
// WEBASSEMBLY-NEXT:#define __BIGGEST_ALIGNMENT__ 16
// WEBASSEMBLY-NEXT:#define __BOOL_WIDTH__ 8
// WEBASSEMBLY-NEXT:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// WEBASSEMBLY-NEXT:#define __CHAR16_TYPE__ unsigned short
// WEBASSEMBLY-NEXT:#define __CHAR32_TYPE__ unsigned int
Expand Down Expand Up @@ -1641,35 +1642,44 @@
// WEBASSEMBLY-NEXT:#define __INT_FAST16_FMTi__ "hi"
// WEBASSEMBLY-NEXT:#define __INT_FAST16_MAX__ 32767
// WEBASSEMBLY-NEXT:#define __INT_FAST16_TYPE__ short
// WEBASSEMBLY-NEXT:#define __INT_FAST16_WIDTH__ 16
// WEBASSEMBLY-NEXT:#define __INT_FAST32_FMTd__ "d"
// WEBASSEMBLY-NEXT:#define __INT_FAST32_FMTi__ "i"
// WEBASSEMBLY-NEXT:#define __INT_FAST32_MAX__ 2147483647
// WEBASSEMBLY-NEXT:#define __INT_FAST32_TYPE__ int
// WEBASSEMBLY-NEXT:#define __INT_FAST32_WIDTH__ 32
// WEBASSEMBLY-NEXT:#define __INT_FAST64_FMTd__ "lld"
// WEBASSEMBLY-NEXT:#define __INT_FAST64_FMTi__ "lli"
// WEBASSEMBLY-NEXT:#define __INT_FAST64_MAX__ 9223372036854775807LL
// WEBASSEMBLY-NEXT:#define __INT_FAST64_TYPE__ long long int
// WEBASSEMBLY-NEXT:#define __INT_FAST64_WIDTH__ 64
// WEBASSEMBLY-NEXT:#define __INT_FAST8_FMTd__ "hhd"
// WEBASSEMBLY-NEXT:#define __INT_FAST8_FMTi__ "hhi"
// WEBASSEMBLY-NEXT:#define __INT_FAST8_MAX__ 127
// WEBASSEMBLY-NEXT:#define __INT_FAST8_TYPE__ signed char
// WEBASSEMBLY-NEXT:#define __INT_FAST8_WIDTH__ 8
// WEBASSEMBLY-NEXT:#define __INT_LEAST16_FMTd__ "hd"
// WEBASSEMBLY-NEXT:#define __INT_LEAST16_FMTi__ "hi"
// WEBASSEMBLY-NEXT:#define __INT_LEAST16_MAX__ 32767
// WEBASSEMBLY-NEXT:#define __INT_LEAST16_TYPE__ short
// WEBASSEMBLY-NEXT:#define __INT_LEAST16_WIDTH__ 16
// WEBASSEMBLY-NEXT:#define __INT_LEAST32_FMTd__ "d"
// WEBASSEMBLY-NEXT:#define __INT_LEAST32_FMTi__ "i"
// WEBASSEMBLY-NEXT:#define __INT_LEAST32_MAX__ 2147483647
// WEBASSEMBLY-NEXT:#define __INT_LEAST32_TYPE__ int
// WEBASSEMBLY-NEXT:#define __INT_LEAST32_WIDTH__ 32
// WEBASSEMBLY-NEXT:#define __INT_LEAST64_FMTd__ "lld"
// WEBASSEMBLY-NEXT:#define __INT_LEAST64_FMTi__ "lli"
// WEBASSEMBLY-NEXT:#define __INT_LEAST64_MAX__ 9223372036854775807LL
// WEBASSEMBLY-NEXT:#define __INT_LEAST64_TYPE__ long long int
// WEBASSEMBLY-NEXT:#define __INT_LEAST64_WIDTH__ 64
// WEBASSEMBLY-NEXT:#define __INT_LEAST8_FMTd__ "hhd"
// WEBASSEMBLY-NEXT:#define __INT_LEAST8_FMTi__ "hhi"
// WEBASSEMBLY-NEXT:#define __INT_LEAST8_MAX__ 127
// WEBASSEMBLY-NEXT:#define __INT_LEAST8_TYPE__ signed char
// WEBASSEMBLY-NEXT:#define __INT_LEAST8_WIDTH__ 8
// WEBASSEMBLY-NEXT:#define __INT_MAX__ 2147483647
// WEBASSEMBLY-NEXT:#define __INT_WIDTH__ 32
// WEBASSEMBLY-NEXT:#define __LDBL_DECIMAL_DIG__ 36
// WEBASSEMBLY-NEXT:#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
// WEBASSEMBLY-NEXT:#define __LDBL_DIG__ 33
Expand All @@ -1685,10 +1695,13 @@
// WEBASSEMBLY-NEXT:#define __LDBL_MIN_EXP__ (-16381)
// WEBASSEMBLY-NEXT:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
// WEBASSEMBLY-NEXT:#define __LITTLE_ENDIAN__ 1
// WEBASSEMBLY-NEXT:#define __LLONG_WIDTH__ 64
// WEBASSEMBLY-NEXT:#define __LONG_LONG_MAX__ 9223372036854775807LL
// WEBASSEMBLY32-NEXT:#define __LONG_MAX__ 2147483647L
// WEBASSEMBLY32-NOT:#define __LP64__
// WEBASSEMBLY32-NEXT:#define __LONG_WIDTH__ 32
// WEBASSEMBLY64-NEXT:#define __LONG_MAX__ 9223372036854775807L
// WEBASSEMBLY64-NEXT:#define __LONG_WIDTH__ 64
// WEBASSEMBLY64-NEXT:#define __LP64__ 1
// WEBASSEMBLY-NEXT:#define __NO_INLINE__ 1
// WEBASSEMBLY-NEXT:#define __NO_MATH_ERRNO__ 1
Expand All @@ -1714,6 +1727,7 @@
// WEBASSEMBLY-NOT:#define __REGISTER_PREFIX__
// WEBASSEMBLY-NEXT:#define __SCHAR_MAX__ 127
// WEBASSEMBLY-NEXT:#define __SHRT_MAX__ 32767
// WEBASSEMBLY-NEXT:#define __SHRT_WIDTH__ 16
// WEBASSEMBLY32-NEXT:#define __SIG_ATOMIC_MAX__ 2147483647L
// WEBASSEMBLY32-NEXT:#define __SIG_ATOMIC_WIDTH__ 32
// WEBASSEMBLY64-NEXT:#define __SIG_ATOMIC_MAX__ 9223372036854775807L
Expand Down
6 changes: 1 addition & 5 deletions clang/www/c_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,7 @@ <h2 id="c2x">C2x implementation status</h2>
<tr>
<td>Two's complement sign representation</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2412.pdf">N2412</a></td>
<td class="partial" align="center">
<details><summary>Partial</summary>
Lacking width macros in limits.h and stdint.h
</details>
</td>
<td class="unreleased" align="center">Clang 14</td>
</tr>
<tr>
<td>Adding the u8 character prefix</td>
Expand Down