aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-10-10 00:28:38 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-10-10 00:28:38 +0100
commitfbc0150dbc66f29c8f7623fc20cbd6a1eda3a4c8 (patch)
tree802f49c062807ad418126a0766d0b31e7ef84f73 /gcc
parent3d5c655fab0ba7e2311cf527b84821296705cef1 (diff)
downloadgcc-fbc0150dbc66f29c8f7623fc20cbd6a1eda3a4c8.zip
gcc-fbc0150dbc66f29c8f7623fc20cbd6a1eda3a4c8.tar.gz
gcc-fbc0150dbc66f29c8f7623fc20cbd6a1eda3a4c8.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr17844-1.c20
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4a2c0e3..bb101fd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-09 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/17844
+ * gcc.dg/pr17844-1.c: New test.
+
2004-10-09 Zdenek Dvorak <dvorakz@suse.cz>
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 0000000..d06bbb6
--- /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 <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)];