mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-10 19:34:29 +00:00
![John McCall](/assets/img/avatar_default.png)
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. llvm-svn: 129342
30 lines
432 B
C++
30 lines
432 B
C++
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
|
|
// rdar: // 8562966
|
|
// pr8409
|
|
|
|
// CHECK: @_ZN1CIiE11needs_guardE = weak_odr global
|
|
// CHECK: @_ZGVN1CIiE11needs_guardE = weak_odr global
|
|
|
|
struct K
|
|
{
|
|
K();
|
|
K(const K &);
|
|
~K();
|
|
void PrintNumK();
|
|
};
|
|
|
|
template<typename T>
|
|
struct C
|
|
{
|
|
void Go() { needs_guard.PrintNumK(); }
|
|
static K needs_guard;
|
|
};
|
|
|
|
template<typename T> K C<T>::needs_guard;
|
|
|
|
void F()
|
|
{
|
|
C<int>().Go();
|
|
}
|
|
|