* gcc.dg/ucnid-[23456].c: XFAIL on AIX.
[official-gcc.git] / gcc / testsuite / gcc.dg / Wchar-subscripts-1.c
blobd1efd25026b450b3c7e4d73ff9360b429de7034d
1 /* Test -Wchar-subscripts. */
2 /* Origin: Joseph Myers <joseph@codesourcery.com> */
3 /* { dg-do compile } */
4 /* { dg-options "-Wchar-subscripts" } */
6 extern int a[];
7 int *p;
8 char c;
9 signed char sc;
10 unsigned char uc;
12 void
13 f (void)
15 a[sc];
16 a[uc];
17 sc[a];
18 uc[a];
19 p[sc];
20 p[uc];
21 sc[p];
22 uc[p];
23 a[c]; /* { dg-warning "warning: array subscript has type 'char'" } */
24 p[c]; /* { dg-warning "warning: array subscript has type 'char'" } */
25 /* -Wchar-subscripts does not warn if the char is not syntactically
26 the subscript. */
27 c[a];
28 c[p];