* g++.dg/init/array2.C: New test.
authorRichard Sandiford <rsandifo@redhat.com>
Wed, 14 Nov 2001 12:54:39 +0000 (12:54 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 14 Nov 2001 12:54:39 +0000 (12:54 +0000)
From-SVN: r47009

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/array2.C [new file with mode: 0644]

index 0932909abf42258c6b713d8f11436dc6143cbcc9..ee057ac924f771ebce230c314c9b1d6e4448a803 100644 (file)
@@ -1,3 +1,7 @@
+2001-11-14  Richard Sandiford  <rsandifo@redhat.com>
+
+       * g++.dg/init/array2.C: New test.
+
 2001-11-14  Alexandre Oliva  <aoliva@redhat.com>
 
        * gcc.c-torture/execute/20010122-1.c: Prevent unwanted inlining.
diff --git a/gcc/testsuite/g++.dg/init/array2.C b/gcc/testsuite/g++.dg/init/array2.C
new file mode 100644 (file)
index 0000000..ca03ff3
--- /dev/null
@@ -0,0 +1,8 @@
+// Check that the type of an array is set correctly when flat initializers
+// are used.
+
+// { dg-do compile }
+
+struct s { int a; int b; };
+struct s x[] = { 1, 2, 3, 4 };
+int y[sizeof (x) == 2 * sizeof (x[0])? 1 : -1];