aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/cxx11-initializer-aggregate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/cxx11-initializer-aggregate.cpp')
-rw-r--r--test/CodeGenCXX/cxx11-initializer-aggregate.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/CodeGenCXX/cxx11-initializer-aggregate.cpp b/test/CodeGenCXX/cxx11-initializer-aggregate.cpp
index acc77825ae84..789970b58b53 100644
--- a/test/CodeGenCXX/cxx11-initializer-aggregate.cpp
+++ b/test/CodeGenCXX/cxx11-initializer-aggregate.cpp
@@ -20,6 +20,25 @@ int &fn2(int &v) {
// CHECK: %[[INITLIST2:.*]] = alloca %struct.B, align 8
// CHECK: %[[R:.*]] = getelementptr inbounds %struct.B* %[[INITLIST2:.*]], i32 0, i32 0
// CHECK: store i32* %{{.*}}, i32** %[[R]], align 8
- // CHECK: call i32* @_ZN1B1fEv(%struct.B* %[[INITLIST2:.*]])
+ // CHECK: call dereferenceable({{[0-9]+}}) i32* @_ZN1B1fEv(%struct.B* %[[INITLIST2:.*]])
return B{v}.f();
}
+
+// CHECK: define {{.*}}@__cxx_global_var_init(
+//
+// CHECK: call {{.*}}@_ZN14NonTrivialInit1AC1Ev(
+// CHECK: getelementptr inbounds {{.*}}, i64 1
+// CHECK: br i1
+//
+// CHECK: getelementptr inbounds {{.*}}, i64 1
+// CHECK: icmp eq {{.*}}, i64 30
+// CHECK: br i1
+//
+// CHECK: call i32 @__cxa_atexit(
+namespace NonTrivialInit {
+ struct A { A(); A(const A&) = delete; ~A(); };
+ struct B { A a[20]; };
+ // NB, this must be large enough to be worth memsetting for this test to be
+ // meaningful.
+ B b[30] = {};
+}