summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/const-init-cxx11.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-17 03:35:37 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-17 03:35:37 +0000
commit14a941380a8171800a41b418a7f63830693c5cfa (patch)
treee15ca669d4539357cf50926f2258158470c50bbb /clang/test/CodeGenCXX/const-init-cxx11.cpp
parenta729c62b81df17a1630de6b8f0709960bee9bc70 (diff)
downloadbcm5719-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.cpp8
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 {
OpenPOWER on IntegriCloud