diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-26 04:02:23 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-26 04:02:23 +0000 |
commit | 071c81065a282edba989bcf7c260b5838a59db50 (patch) | |
tree | 29eabf306a0c7ab6e5fdbe45fb328c325456786b /test/CodeGenCXX/static-init.cpp | |
parent | 314cba02728c451c783b38bf6c00f220afb193c8 (diff) |
Make sure to always mark a global variable as not being constant if it has a C++ initializer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/static-init.cpp')
-rw-r--r-- | test/CodeGenCXX/static-init.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp index cbd90e7894..33d92d6853 100644 --- a/test/CodeGenCXX/static-init.cpp +++ b/test/CodeGenCXX/static-init.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s + +// CHECK: @_ZZ1hvE1i = internal global i32 0, align 4 struct A { A(); ~A(); @@ -15,3 +17,8 @@ void g() { // CHECK: call void @_ZN1AC1Ev( static A& a = *new A; } + +int a(); +void h() { + static const int i = a(); +} |