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