[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / static-init-3.cpp
blob3260ab1eb9a624b445feb6bb8d9461e12e817b38
1 // RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10.0.0 -o - %s | FileCheck %s
3 // PR7050
4 template<class T> struct X0 : public T { };
6 template <class T>
7 struct X1
9 static T & instance;
10 // include this to provoke instantiation at pre-execution time
11 static void use(T const &) {}
12 static T & get() {
13 static X0<T> t;
14 use(instance);
15 return static_cast<T &>(t);
19 // CHECK: @_ZN2X1I2X2I1BEE8instanceE = linkonce_odr global ptr null, align 8
20 // CHECJ: @_ZN2X1I2X2I1AEE8instanceE = linkonce_odr global ptr null, align 8
21 template<class T> T & X1<T>::instance = X1<T>::get();
23 class A { };
24 class B : public A { };
26 template<typename T> struct X2 {};
27 X2< B > bg = X1< X2< B > >::get();
28 X2< A > ag = X1< X2< A > >::get();