diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-06-13 23:04:49 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-06-13 23:04:49 +0000 |
| commit | 8edda962962cf3143491e54aad2c9aa2b07d14ae (patch) | |
| tree | 8a870911f33b4070424c21e860c9d0b0fd247491 /clang/test | |
| parent | a0cdc005dde2ffdb81d10866a13e88449b091168 (diff) | |
| download | bcm5719-llvm-8edda962962cf3143491e54aad2c9aa2b07d14ae.tar.gz bcm5719-llvm-8edda962962cf3143491e54aad2c9aa2b07d14ae.zip | |
A non-trivial array-fill expression isn't necessarily a CXXConstructExpr. It
could be an InitListExpr that runs constructors in C++11 onwards. Fixes a
recent regression (introduced in r210091).
llvm-svn: 210954
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CodeGenCXX/cxx11-initializer-aggregate.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/cxx11-initializer-aggregate.cpp b/clang/test/CodeGenCXX/cxx11-initializer-aggregate.cpp index 99994bd9ffa..94f305855b4 100644 --- a/clang/test/CodeGenCXX/cxx11-initializer-aggregate.cpp +++ b/clang/test/CodeGenCXX/cxx11-initializer-aggregate.cpp @@ -23,3 +23,22 @@ int &fn2(int &v) { // CHECK: call nonnull 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] = {}; +} |

