summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/const-init-cxx11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/const-init-cxx11.cpp')
-rw-r--r--test/CodeGenCXX/const-init-cxx11.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGenCXX/const-init-cxx11.cpp b/test/CodeGenCXX/const-init-cxx11.cpp
index 62a345a..db1bb41 100644
--- a/test/CodeGenCXX/const-init-cxx11.cpp
+++ b/test/CodeGenCXX/const-init-cxx11.cpp
@@ -49,6 +49,17 @@ namespace StructUnion {
// CHECK: @_ZN11StructUnion1fE = global {{.*}} { i32 5 }
D f;
+
+ union E {
+ int a;
+ void *b = &f;
+ };
+
+ // CHECK: @_ZN11StructUnion1gE = global {{.*}} @_ZN11StructUnion1fE
+ E g;
+
+ // CHECK: @_ZN11StructUnion1hE = global {{.*}} @_ZN11StructUnion1fE
+ E h = E();
}
namespace BaseClass {
@@ -110,6 +121,13 @@ namespace Array {
};
// CHECK: @_ZN5Array1eE = constant {{.*}} { [4 x i8] c"foo\00", [4 x i8] c"x\00\00\00" }
extern constexpr E e = E();
+
+ // PR13290
+ struct F { constexpr F() : n(4) {} int n; };
+ // CHECK: @_ZN5Array2f1E = global {{.*}} zeroinitializer
+ F f1[1][1][0] = { };
+ // CHECK: @_ZN5Array2f2E = global {{.* i32 4 .* i32 4 .* i32 4 .* i32 4 .* i32 4 .* i32 4 .* i32 4 .* i32 4}}
+ F f2[2][2][2] = { };
}
namespace MemberPtr {
@@ -298,6 +316,20 @@ namespace VirtualMembers {
static nsMemoryImpl sGlobalMemory;
}
+namespace PR13273 {
+ struct U {
+ int t;
+ U() = default;
+ };
+
+ struct S : U {
+ S() = default;
+ };
+
+ // CHECK: @_ZN7PR132731sE = {{.*}} zeroinitializer
+ extern const S s {};
+}
+
// Constant initialization tests go before this point,
// dynamic initialization tests go after.
OpenPOWER on IntegriCloud