diff options
author | John McCall <rjmccall@apple.com> | 2011-04-12 01:46:54 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-04-12 01:46:54 +0000 |
commit | 99ace16bc6962f1fc3dc45bbbdf2eb74e555a8ad (patch) | |
tree | 84800e26bace4f942fa56acdc48fea63dd0a1f7a /test/CodeGenCXX/global-init.cpp | |
parent | 1d1a679090afe8468c6c95f8ab9c3192683ac69f (diff) | |
download | clang-99ace16bc6962f1fc3dc45bbbdf2eb74e555a8ad.tar.gz |
Template static data members can have weak_odr linkage, not just
weak linkage. Also, fix a problem where global weak variables
with non-trivial initializers were getting guard variables, or at
least were checking for them and then crashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129342 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/global-init.cpp')
-rw-r--r-- | test/CodeGenCXX/global-init.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGenCXX/global-init.cpp b/test/CodeGenCXX/global-init.cpp index 53cfe05fd7..f9eeb59145 100644 --- a/test/CodeGenCXX/global-init.cpp +++ b/test/CodeGenCXX/global-init.cpp @@ -97,6 +97,16 @@ namespace test5 { }; } +namespace test6 { + struct A { + A(); + }; + extern int foo(); + + // This needs an initialization function but not guard variables. + __attribute__((weak)) int x = foo(); +} + // At the end of the file, we check that y is initialized before z. // CHECK: define internal void @_GLOBAL__I_a() section "__TEXT,__StaticInit,regular,pure_instructions" { |