summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/const6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/init/const6.C')
-rw-r--r--gcc/testsuite/g++.dg/init/const6.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/init/const6.C b/gcc/testsuite/g++.dg/init/const6.C
new file mode 100644
index 000000000..e626bfeac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/const6.C
@@ -0,0 +1,27 @@
+// PR c++/36688
+// { dg-do run }
+// { dg-options "-O2" }
+
+struct S
+{
+ long long a;
+ long long b;
+ long long c;
+};
+
+struct T
+{
+ S g;
+ long long h[12];
+};
+
+static const S s = { 1, 2, 3 };
+static const T t = { s, 0 };
+
+int
+main ()
+{
+ T x = t;
+ if (__builtin_memcmp (&x, &t, sizeof (T)))
+ __builtin_abort ();
+}