* gcc.dg/20011008-1.c: New.
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2001 19:42:40 +0000 (19:42 +0000)
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2001 19:42:40 +0000 (19:42 +0000)
* gcc.dg/20011008-2.c: New.

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

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 a314286..decc7d1 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);
+}