20011008-1.c: New.
authorDJ Delorie <dj@redhat.com>
Mon, 8 Oct 2001 19:42:40 +0000 (15:42 -0400)
committerDJ Delorie <dj@gcc.gnu.org>
Mon, 8 Oct 2001 19:42:40 +0000 (15:42 -0400)
* gcc.dg/20011008-1.c: New.
* gcc.dg/20011008-2.c: New.

From-SVN: r46087

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

index a314286409d3fe88123eab5893e0110ae2e26bfb..decc7d10f4ac4657d1f0097b9d1ad960ef014831 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-08  DJ Delorie  <dj@redhat.com>
+
+       * gcc.dg/20011008-1.c: New.
+       * gcc.dg/20011008-2.c: New.
+
 2001-10-08  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * gcc.dg/cpp/spacing1.c: Update test.
diff --git a/gcc/testsuite/gcc.dg/20011008-1.c b/gcc/testsuite/gcc.dg/20011008-1.c
new file mode 100644 (file)
index 0000000..5ac821c
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+struct { int; int q; } a; /* { dg-error "unnamed" } */
+struct { union {int x;}; int q; } b;
+struct { struct {int x;}; int q; } c;
+union { union {int x;}; int q; } d;
+union { struct {int x;}; int q; } e;
diff --git a/gcc/testsuite/gcc.dg/20011008-2.c b/gcc/testsuite/gcc.dg/20011008-2.c
new file mode 100644 (file)
index 0000000..5937bcb
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+struct { union {int x; int y;}; int q; } b;
+union { struct {int x;}; int q; } e;
+
+main()
+{
+  b.y = 10;
+  b.x = 15;
+  if (b.y != 15)
+    abort();
+
+  e.x = 10;
+  e.q = 15;
+  if (e.x != 15)
+    abort();
+
+  exit(0);
+}