summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr17844-1.c
blob: d06bbb6d74a50bb6749a39bbc1f4c41e3144bd92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* -fshort-enums should affect only the type with which an enum is
    compatible, not the type of the enumeration constants which should
    still be int.  Bug 17844.  */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-fshort-enums" } */

enum e { A, B };

enum e ev;
unsigned char uv;
enum e *ep = &uv;
unsigned char *up = &ev;

int i;
__typeof__(A) te;
int *ip = &te;
__typeof__(B) *tep = &i;

int x[((sizeof(A) == sizeof(int)) ? 1 : -1)];