summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/linkage.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2014-01-30 01:12:47 +0000
committerJohn McCall <rjmccall@apple.com>2014-01-30 01:12:47 +0000
commita900d1cf4a2901464d9da3662eba9938edfe09f1 (patch)
treea40f124a9a122056f890e719e6fbce3918503629 /clang/test/SemaCXX/linkage.cpp
parentf48f13527e086a4f519c0e5ad28a19a3436c74b9 (diff)
downloadbcm5719-llvm-a900d1cf4a2901464d9da3662eba9938edfe09f1.tar.gz
bcm5719-llvm-a900d1cf4a2901464d9da3662eba9938edfe09f1.zip
Actually test that the local static variable from my
test in r200380 gets linkonce_odr linkage. llvm-svn: 200437
Diffstat (limited to 'clang/test/SemaCXX/linkage.cpp')
-rw-r--r--clang/test/SemaCXX/linkage.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/linkage.cpp b/clang/test/SemaCXX/linkage.cpp
index 46bd3b2441c..8a2013fd52b 100644
--- a/clang/test/SemaCXX/linkage.cpp
+++ b/clang/test/SemaCXX/linkage.cpp
@@ -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();
+ }
}
OpenPOWER on IntegriCloud