aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-01-07 21:05:14 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2005-01-07 21:05:14 +0100
commitb827788f5768220700c66beaee6a66586014f07f (patch)
tree57a2412ddbafbe7c78a634ebf6e0b4c623253827 /gcc/testsuite
parent825bd0e1e8f9f76c2cbe52e9ebe4fd15bcd701f7 (diff)
downloadgcc-b827788f5768220700c66beaee6a66586014f07f.zip
gcc-b827788f5768220700c66beaee6a66586014f07f.tar.gz
gcc-b827788f5768220700c66beaee6a66586014f07f.tar.bz2
c-common.c (handle_mode_attribute): For ENUMERAL_TYPE, also copy TYPE_MODE.
* c-common.c (handle_mode_attribute): For ENUMERAL_TYPE, also copy TYPE_MODE. * gcc.c-torture/execute/20050107-1.c: New test. From-SVN: r93066
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20050107-1.c25
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 46a2093..9d46008 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2005-01-07 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/20050107-1.c: New test.
+
2005-01-07 Nathan Sidwell <nathan@codesourcery.com>
PR c++/19298
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050107-1.c b/gcc/testsuite/gcc.c-torture/execute/20050107-1.c
new file mode 100644
index 0000000..903c54a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20050107-1.c
@@ -0,0 +1,25 @@
+typedef enum { C = 1, D = 2 } B;
+extern void abort (void);
+
+struct S
+{
+ B __attribute__ ((mode (byte))) a;
+ B __attribute__ ((mode (byte))) b;
+};
+
+void
+foo (struct S *x)
+{
+ if (x->a != C || x->b != D)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct S s;
+ s.a = C;
+ s.b = D;
+ foo (&s);
+ return 0;
+}