OSDN Git Service

PR c/17844
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 9 Oct 2004 23:28:38 +0000 (23:28 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 9 Oct 2004 23:28:38 +0000 (23:28 +0000)
* gcc.dg/pr17844-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88829 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr17844-1.c [new file with mode: 0644]

index 4a2c0e3..bb101fd 100644 (file)
@@ -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
 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 (file)
index 0000000..d06bbb6
--- /dev/null
@@ -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)];