Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/enum1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 /* { dg-do run } */ |
2 /* { dg-options "-std=gnu89" } */ | |
3 | |
4 /* In standard C, enumeration constants always have type int. If they | |
5 are not representables are int, they're ill-formed. In GNU C, we | |
6 give such ill-formed constructs well-defined meaning. Make sure it | |
7 works. */ | |
8 | |
9 #include <stdlib.h> | |
10 | |
11 enum foo | |
12 { | |
13 foo1 = 0, | |
14 foo2 = 0xffffffffffffffffULL, | |
15 foo3 = 0xf0fffffffffffffeULL | |
16 }; | |
17 | |
18 int main () | |
19 { | |
20 if (sizeof (enum foo) != sizeof (unsigned long long)) | |
21 abort (); | |
22 exit (0); | |
23 } |