diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-07 22:48:24 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-07 22:48:24 +0000 |
commit | de31aa7f0ef71f5c162372e319cbc03c0924f074 (patch) | |
tree | 2612888134d42a9a1c826548a89e4bfb012ba582 /test/CodeGenCXX/const-init-cxx11.cpp | |
parent | 254a8fb01cbd3dd5b91b97100f74cbe2c8842d54 (diff) |
PR13290: Constant-evaluation support for CXXConstructExprs which construct a
multidimensional array of class type. Also, preserve zero-initialization when
evaluating an initializer list for an array, in case the initializers refer to
later elements (which have preceding zero-initialization).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/const-init-cxx11.cpp')
-rw-r--r-- | test/CodeGenCXX/const-init-cxx11.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGenCXX/const-init-cxx11.cpp b/test/CodeGenCXX/const-init-cxx11.cpp index 07385eedba..d2504d78cd 100644 --- a/test/CodeGenCXX/const-init-cxx11.cpp +++ b/test/CodeGenCXX/const-init-cxx11.cpp @@ -121,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 { |