diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-07 02:03:08 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-07 02:03:08 +0000 |
commit | cee2d2f016c2f8bd7cb7bdc7258c10c0b969ecbb (patch) | |
tree | 8783ea222c55d190b8bfb6309f4d353d3cfa92af /clang/test/CodeGenCXX/static-init.cpp | |
parent | 10d369d1a22fdeaeb044b3db8a9126f71cb0c7ad (diff) | |
download | bcm5719-llvm-cee2d2f016c2f8bd7cb7bdc7258c10c0b969ecbb.tar.gz bcm5719-llvm-cee2d2f016c2f8bd7cb7bdc7258c10c0b969ecbb.zip |
Use the right linkage for static variables inside C++ inline functions.
llvm-svn: 95512
Diffstat (limited to 'clang/test/CodeGenCXX/static-init.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/static-init.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/static-init.cpp b/clang/test/CodeGenCXX/static-init.cpp index 33d92d68536..a67d137d6a1 100644 --- a/clang/test/CodeGenCXX/static-init.cpp +++ b/clang/test/CodeGenCXX/static-init.cpp @@ -1,6 +1,10 @@ // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s // CHECK: @_ZZ1hvE1i = internal global i32 0, align 4 + +// CHECK: @_ZZ2h2vE1i = weak global i32 0 +// CHECK: @_ZGVZ2h2vE1i = weak global i64 0 + struct A { A(); ~A(); @@ -22,3 +26,11 @@ int a(); void h() { static const int i = a(); } + +inline void h2() { + static int i = a(); +} + +void h3() { + h2(); +} |