summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/constructor-init.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-01 21:08:19 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-01 21:08:19 +0000
commit82e1af20cb6393345bf53259465d63743d9b60db (patch)
tree4a00cb691a2a70506f189fd2f62002e46772dd23 /clang/test/CodeGenCXX/constructor-init.cpp
parent0d639a28aa3f3404e66286f2f918e06b4249ecbb (diff)
downloadbcm5719-llvm-82e1af20cb6393345bf53259465d63743d9b60db.tar.gz
bcm5719-llvm-82e1af20cb6393345bf53259465d63743d9b60db.zip
Don't zero-initialize default-initialized local variables that have
trivial default constructors. This generated-code regression was caused by r131796, which had simplified the handling of default initialization in Sema. Fixes <rdar://problem/9694300>. llvm-svn: 134260
Diffstat (limited to 'clang/test/CodeGenCXX/constructor-init.cpp')
-rw-r--r--clang/test/CodeGenCXX/constructor-init.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/constructor-init.cpp b/clang/test/CodeGenCXX/constructor-init.cpp
index 47e3b7b0bb9..f439083c077 100644
--- a/clang/test/CodeGenCXX/constructor-init.cpp
+++ b/clang/test/CodeGenCXX/constructor-init.cpp
@@ -133,3 +133,19 @@ template<typename T>
X<T>::X(const X &other) : start(0), end(0) { }
X<int> get_X(X<int> x) { return x; }
+
+namespace rdar9694300 {
+ struct X {
+ int x;
+ };
+
+ // CHECK: define void @_ZN11rdar96943001fEv
+ void f() {
+ // CHECK: alloca
+ X x;
+ // CHECK-NEXT: [[I:%.*]] = alloca i32
+ // CHECK-NEXT: store i32 17, i32* [[I]]
+ int i = 17;
+ // CHECK-NEXT: ret void
+ }
+}
OpenPOWER on IntegriCloud