New test.
authorRichard Henderson <rth@gcc.gnu.org>
Tue, 4 Dec 2001 01:25:32 +0000 (17:25 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 4 Dec 2001 01:25:32 +0000 (17:25 -0800)
From-SVN: r47589

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

diff --git a/gcc/testsuite/gcc.dg/struct-alias-1.c b/gcc/testsuite/gcc.dg/struct-alias-1.c
new file mode 100644 (file)
index 0000000..6cfadcf
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+struct S {
+   int a[3];
+   int x;
+};
+
+extern void link_error(void);
+static int i;
+
+int main()
+{
+  struct S s;
+
+  s.x = 0;
+  s.a[i] = 1;
+  if (s.x != 0)
+    link_error ();
+
+  return 0;
+}