summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/static-init.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-07 02:03:08 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-07 02:03:08 +0000
commitf6b89a173827457c28ac77b7cf091a24ef484e8a (patch)
tree7cb0efa647547c0ed2e22476306c10eb2e7833b0 /test/CodeGenCXX/static-init.cpp
parent39de84d671bac60662251e98f20a5a6039795dfc (diff)
Use the right linkage for static variables inside C++ inline functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/static-init.cpp')
-rw-r--r--test/CodeGenCXX/static-init.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp
index 33d92d6853..a67d137d6a 100644
--- a/test/CodeGenCXX/static-init.cpp
+++ b/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();
+}