From: Joseph Myers Date: Sat, 9 Oct 2004 23:28:38 +0000 (+0100) Subject: re PR c/17844 (-fshort-enums: ISO/IEC 9899:1999 : wrong size of identifier in enumera... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fbc0150dbc66f29c8f7623fc20cbd6a1eda3a4c8;p=gcc.git re PR c/17844 (-fshort-enums: ISO/IEC 9899:1999 : wrong size of identifier in enumerator list) PR c/17844 * gcc.dg/pr17844-1.c: New test. From-SVN: r88829 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4a2c0e38eb2..bb101fd2b28 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-10-09 Joseph S. Myers + + PR c/17844 + * gcc.dg/pr17844-1.c: New test. + 2004-10-09 Zdenek Dvorak PR tree-optimization/17906 diff --git a/gcc/testsuite/gcc.dg/pr17844-1.c b/gcc/testsuite/gcc.dg/pr17844-1.c new file mode 100644 index 00000000000..d06bbb6d74a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr17844-1.c @@ -0,0 +1,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 */ +/* { 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)];