aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/other/anon-union.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/other/anon-union.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/other/anon-union.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/other/anon-union.C b/gcc-4.9/gcc/testsuite/g++.dg/other/anon-union.C
new file mode 100644
index 000000000..51598bf3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/other/anon-union.C
@@ -0,0 +1,22 @@
+// { dg-do compile }
+// { dg-options -O2 }
+
+int foo ();
+double bar (void)
+{
+ union
+ {
+ char a[8];
+ double b;
+ };
+
+ a[0] = foo ();
+ a[1] = foo ();
+ a[2] = foo ();
+ a[3] = foo ();
+ a[4] = foo ();
+ a[5] = foo ();
+ a[6] = foo ();
+ a[7] = foo ();
+ return b;
+}