diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-17 03:35:37 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-17 03:35:37 +0000 |
| commit | 14a941380a8171800a41b418a7f63830693c5cfa (patch) | |
| tree | e15ca669d4539357cf50926f2258158470c50bbb /clang/test/CodeGenCXX/const-init-cxx11.cpp | |
| parent | a729c62b81df17a1630de6b8f0709960bee9bc70 (diff) | |
| download | bcm5719-llvm-14a941380a8171800a41b418a7f63830693c5cfa.tar.gz bcm5719-llvm-14a941380a8171800a41b418a7f63830693c5cfa.zip | |
Make sure all remaining parts of the constant evaluator are aware that an array
can be represented by an LValue, and use that to simplify the code a little.
llvm-svn: 150789
Diffstat (limited to 'clang/test/CodeGenCXX/const-init-cxx11.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/const-init-cxx11.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/const-init-cxx11.cpp b/clang/test/CodeGenCXX/const-init-cxx11.cpp index fa56f598089..14a2f877170 100644 --- a/clang/test/CodeGenCXX/const-init-cxx11.cpp +++ b/clang/test/CodeGenCXX/const-init-cxx11.cpp @@ -94,6 +94,14 @@ namespace Array { // CHECK: @_ZN5Array1dE = constant {{.*}} { [2 x i32] [i32 1, i32 2], [3 x i32] [i32 3, i32 4, i32 5] } struct D { int n[2]; int m[3]; } extern constexpr d = { 1, 2, 3, 4, 5 }; + + struct E { + char c[4]; + char d[4]; + constexpr E() : c("foo"), d("x") {} + }; + // CHECK: @_ZN5Array1eE = global {{.*}} { [4 x i8] c"foo\00", [4 x i8] c"x\00\00\00" } + extern constexpr E e = E(); } namespace MemberPtr { |

