summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-05-09 07:14:00 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-05-09 07:14:00 +0000
commit6391ea2897b595178a8a97e5080f59a6f55ce442 (patch)
tree2986ecceb0dc3fd9f904947ef41691e6b141fc6f /test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
parentafde200cdae9731aa5826c6178eae9e7fef74475 (diff)
Implement C++1y constant initializer rules: in a constant initializer for an
object x, x's subobjects can be constructed by constexpr constructor even if they are of non-literal type, and can be read and written even though they're not members of a constexpr object or temporary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/cxx1y-initializer-aggregate.cpp')
-rw-r--r--test/CodeGenCXX/cxx1y-initializer-aggregate.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp b/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
index ef78c434e3..ae49a047f6 100644
--- a/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
+++ b/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp
@@ -25,7 +25,11 @@ A b { 4, "bazquux", .x = 42, .c = 9 };
A c { 1, 0, 'A', f(), { 3 } };
// CHECK: @[[STR_A:.*]] = {{.*}} [7 x i8] c"foobar\00"
+// CHECK: @a = global {{.*}} zeroinitializer
+
+// @b has a constant initializer
// CHECK: @[[STR_B:.*]] = {{.*}} [8 x i8] c"bazquux\00"
+// CHECK: @b = global {{.*}} i32 4, {{.*}} @[[STR_B]], {{.*}} i8 117, i32 42, {{.*}} i8 9
B x;
B y {};
@@ -44,18 +48,9 @@ B z { 1 };
// CHECK: store i32 %{{.*}}, i32* getelementptr inbounds ({{.*}}* @a, i32 0, i32 3)
// CHECK: call void @{{.*}}C1Ev({{.*}} getelementptr inbounds (%struct.A* @a, i32 0, i32 4))
-// Initialization of 'b':
+// No dynamic initialization of 'b':
-// CHECK: store i32 4, i32* getelementptr inbounds ({{.*}} @b, i32 0, i32 0)
-// CHECK: store i8* {{.*}} @[[STR_B]]{{.*}}, i8** getelementptr inbounds ({{.*}} @b, i32 0, i32 1)
-// CHECK: load i32* getelementptr inbounds ({{.*}} @b, i32 0, i32 0)
-// CHECK: load i8** getelementptr inbounds ({{.*}} @b, i32 0, i32 1)
-// CHECK: getelementptr inbounds i8* %{{.*}}, {{.*}} %{{.*}}
-// CHECK: store i8 %{{.*}}, i8* getelementptr inbounds ({{.*}} @b, i32 0, i32 2)
-// CHECK-NOT: @_ZN1A1fEv
-// CHECK: store i32 42, i32* getelementptr inbounds ({{.*}}* @b, i32 0, i32 3)
-// CHECK-NOT: C1Ev
-// CHECK: store i8 9, i8* {{.*}} @b, i32 0, i32 4)
+// CHECK-NOT: @b
// Initialization of 'c':