diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-01 21:08:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-01 21:08:19 +0000 |
commit | bcc3e660a1fdc19722157ef3e2f133418856ca3d (patch) | |
tree | 06c41ab25f97aa8ce03de107727768041fc7f6c4 /test/CodeGenCXX/constructor-init.cpp | |
parent | 31fd2b7881efc6b7b1e466823c10c64ba5ddffe3 (diff) |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/constructor-init.cpp')
-rw-r--r-- | test/CodeGenCXX/constructor-init.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGenCXX/constructor-init.cpp b/test/CodeGenCXX/constructor-init.cpp index 47e3b7b0bb..f439083c07 100644 --- a/test/CodeGenCXX/constructor-init.cpp +++ b/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 + } +} |