1 // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
3 #define for 0 // expected-warning {{keyword is hidden by macro definition}}
17 // allowlisted definitions
30 #define inline __inline
32 #define inline __inline__
35 #define inline inline__ // expected-warning {{keyword is hidden by macro definition}}
37 #define extern __inline // expected-warning {{keyword is hidden by macro definition}}
39 #define extern __extern // expected-warning {{keyword is hidden by macro definition}}
41 #define extern __extern__ // expected-warning {{keyword is hidden by macro definition}}
44 #define inline _inline // expected-warning {{keyword is hidden by macro definition}}
46 #define volatile // expected-warning {{keyword is hidden by macro definition}}
49 #pragma clang diagnostic warning "-Wreserved-macro-identifier"
51 #define switch if // expected-warning {{keyword is hidden by macro definition}}
53 #define __clusplus // expected-warning {{macro name is a reserved identifier}}
54 #define __HAVE_X 0 // expected-warning {{macro name is a reserved identifier}}
55 #define _HAVE_X 0 // expected-warning {{macro name is a reserved identifier}}
60 #undef __cplusplus // expected-warning {{macro name is a reserved identifier}}
61 #undef _HAVE_X // expected-warning {{macro name is a reserved identifier}}
66 #define _GNU_SOURCE // no-warning
67 #define __STDC_FORMAT_MACROS // no-warning