]> granicus.if.org Git - clang/commitdiff
Actually test that the local static variable from my
authorJohn McCall <rjmccall@apple.com>
Thu, 30 Jan 2014 01:12:47 +0000 (01:12 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 30 Jan 2014 01:12:47 +0000 (01:12 +0000)
test in r200380 gets linkonce_odr linkage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200437 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/linkage.cpp

index 46bd3b2441cd8d30968570d032317ef4f0675964..8a2013fd52b421ad2df1e7f4cb75fc3b7c49af06 100644 (file)
@@ -5,6 +5,8 @@
 
 // RUN: %clang_cc1 -Werror -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
 
+// CHECK: @_ZZN5test61A3fooEvE3bar = linkonce_odr global i32 0, align 4
+
 // PR8926
 namespace test0 {
   typedef struct {
@@ -108,8 +110,15 @@ namespace test5 {
 // processing a record decl.  rdar://15928125
 namespace test6 {
   typedef struct {
-    void foo() {
-      static int bar = 0; 
+    int foo() {
+      // Tested at top of file.
+      static int bar = 0;
+      return bar++;
     }
   } A;
+
+  void test() {
+    A a;
+    a.foo();
+  }
 }