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 | 20bbbd489bf1b66e079f39708406148bcbb65b06 (patch) | |
tree | 8c6ab473066e1a0cfb818518ae1eee6e52a5092c /clang/test/CodeGenCXX/static-init.cpp | |
parent | 19afd61201b121ee878a2eac6e03a8887cf68b1b (diff) | |
download | bcm5719-llvm-20bbbd489bf1b66e079f39708406148bcbb65b06.tar.gz bcm5719-llvm-20bbbd489bf1b66e079f39708406148bcbb65b06.zip |
Make sure to always mark a global variable as not being constant if it has a C++ initializer.
llvm-svn: 94504
Diffstat (limited to 'clang/test/CodeGenCXX/static-init.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/static-init.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/static-init.cpp b/clang/test/CodeGenCXX/static-init.cpp index cbd90e78940..33d92d68536 100644 --- a/clang/test/CodeGenCXX/static-init.cpp +++ b/clang/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(); +} |