1 // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
3 #define for 0 // expected-warning {{keyword is hidden by macro definition}}
9 #define __STDC__ 1 // expected-warning {{redefining builtin macro}}
18 #undef __STDC_HOSTED__ // expected-warning {{undefining builtin macro}}
20 #undef __UINT32_TYPE__
21 #undef __UINTPTR_TYPE__
22 #undef __UINT64_TYPE__
26 // allowlisted definitions
39 #define inline __inline
41 #define inline __inline__
44 #define inline inline__ // expected-warning {{keyword is hidden by macro definition}}
46 #define extern __inline // expected-warning {{keyword is hidden by macro definition}}
48 #define extern __extern // expected-warning {{keyword is hidden by macro definition}}
50 #define extern __extern__ // expected-warning {{keyword is hidden by macro definition}}
53 #define inline _inline // expected-warning {{keyword is hidden by macro definition}}
55 #define volatile // expected-warning {{keyword is hidden by macro definition}}
58 #pragma clang diagnostic warning "-Wreserved-macro-identifier"
60 #define switch if // expected-warning {{keyword is hidden by macro definition}}
62 #define __clusplus // expected-warning {{macro name is a reserved identifier}}
63 #define __HAVE_X 0 // expected-warning {{macro name is a reserved identifier}}
64 #define _HAVE_X 0 // expected-warning {{macro name is a reserved identifier}}
69 #undef __cplusplus // expected-warning {{macro name is a reserved identifier}}
70 #undef _HAVE_X // expected-warning {{macro name is a reserved identifier}}
75 #define _GNU_SOURCE // no-warning
76 #define __STDC_FORMAT_MACROS // no-warning