r200437 - Actually test that the local static variable from my
John McCall
rjmccall at apple.com
Wed Jan 29 17:12:48 PST 2014
Author: rjmccall
Date: Wed Jan 29 19:12:47 2014
New Revision: 200437
URL: http://llvm.org/viewvc/llvm-project?rev=200437&view=rev
Log:
Actually test that the local static variable from my
test in r200380 gets linkonce_odr linkage.
Modified:
cfe/trunk/test/SemaCXX/linkage.cpp
Modified: cfe/trunk/test/SemaCXX/linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/linkage.cpp?rev=200437&r1=200436&r2=200437&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/linkage.cpp (original)
+++ cfe/trunk/test/SemaCXX/linkage.cpp Wed Jan 29 19:12:47 2014
@@ -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();
+ }
}
More information about the cfe-commits
mailing list