diff options
author | Matthias Braun <matze@braunis.de> | 2017-01-10 17:43:01 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2017-01-10 17:43:01 +0000 |
commit | 2b6d6f109e5d8f59d4a2ddbd08337f0610577ce5 (patch) | |
tree | fce356acddd9dfd7b1b4cad09fd50e2b4f9bddab /test/CodeGenCXX/pr31054.cpp | |
parent | 96e79e3c6fd833646bd7184acea359f40dfd9d1f (diff) |
CGDecl: Skip static variable initializers in unreachable code
This fixes http://llvm.org/PR31054
Differential Revision: https://reviews.llvm.org/D28505
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/pr31054.cpp')
-rw-r--r-- | test/CodeGenCXX/pr31054.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGenCXX/pr31054.cpp b/test/CodeGenCXX/pr31054.cpp new file mode 100644 index 0000000000..33b17b9eaf --- /dev/null +++ b/test/CodeGenCXX/pr31054.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s + +struct A { ~A(); }; +void func() { + return; + static A k; +} + +// Test that we did not crash, by checking whether function was created. +// CHECK-LABEL: define void @_Z4funcv() #0 { +// CHECK: ret void +// CHECK: } |