summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/ucnid-11.c
blob: b6956f5445436a4284b8c98b18d2134547093112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Test spelling differences in UCNs are properly diagnosed for macro
   redefinitions.  */
/* { dg-do preprocess } */
/* { dg-options "-std=c99 -pedantic-errors" } */

/* Different spelling of UCN in expansion.  */
#define m1 \u00c1 /* { dg-message "-:previous definition" } */
#define m1 \u00C1 /* { dg-error "-:redefined" } */

#define m1ok \u00c1
#define m1ok \u00c1

/* Different spelling of UCN in argument name.  */
#define m2(\u00c1) /* { dg-message "-:previous definition" } */
#define m2(\u00C1) /* { dg-error "-:redefined" } */

#define m2ok(\u00c1)
#define m2ok(\u00c1)

/* Same spelling in argument name but different spelling when used in
   expansion.  */
#define m3(\u00c1) \u00c1 /* { dg-message "-:previous definition" } */
#define m3(\u00c1) \u00C1 /* { dg-error "-:redefined" } */

#define m3ok(\u00c1) \u00C1
#define m3ok(\u00c1) \u00C1

/* Different spelling of the macro name itself is OK.  */
#define m4ok\u00c1
#define m4ok\u00C1