xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
2f4a2713aSLionel Sambuc // rdar: // 8562966
3f4a2713aSLionel Sambuc // pr8409
4f4a2713aSLionel Sambuc 
5*0a6a1f1dSLionel Sambuc // CHECK: @_ZN1CIiE11needs_guardE = linkonce_odr global
6*0a6a1f1dSLionel Sambuc // CHECK: @_ZGVN1CIiE11needs_guardE = linkonce_odr global
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc struct K
9f4a2713aSLionel Sambuc {
10f4a2713aSLionel Sambuc   K();
11f4a2713aSLionel Sambuc   K(const K &);
12f4a2713aSLionel Sambuc   ~K();
13f4a2713aSLionel Sambuc   void PrintNumK();
14f4a2713aSLionel Sambuc };
15f4a2713aSLionel Sambuc 
16f4a2713aSLionel Sambuc template<typename T>
17f4a2713aSLionel Sambuc struct C
18f4a2713aSLionel Sambuc {
GoC19f4a2713aSLionel Sambuc   void Go() { needs_guard.PrintNumK(); }
20f4a2713aSLionel Sambuc   static K needs_guard;
21f4a2713aSLionel Sambuc };
22f4a2713aSLionel Sambuc 
23f4a2713aSLionel Sambuc template<typename T> K C<T>::needs_guard;
24f4a2713aSLionel Sambuc 
F()25f4a2713aSLionel Sambuc void F()
26f4a2713aSLionel Sambuc {
27f4a2713aSLionel Sambuc   C<int>().Go();
28f4a2713aSLionel Sambuc }
29f4a2713aSLionel Sambuc 
30