summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/cxx1y-initializer-aggregate.cpp')
-rw-r--r--test/CodeGenCXX/cxx1y-initializer-aggregate.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp b/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
index 8bdf863..098a4b9 100644
--- a/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
+++ b/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
@@ -36,6 +36,17 @@ B y {};
B z { 1 };
// CHECK: @z = global {{.*}} { i32 1 }
+// Brace initialization should initialize the first field even though it is
+// unnamed.
+union C {
+ struct {
+ int C::*memptr;
+ };
+};
+
+C n{};
+// CHECK: @n = global %union.C { %struct.anon { i64 -1 } }, align 8
+
// Initialization of 'a':
// CHECK: store i32 0, i32* getelementptr inbounds ({{.*}} @a, i32 0, i32 0)
OpenPOWER on IntegriCloud