1 // RUN: %clang_cc1 -emit-llvm -triple i686-windows-itanium -fdeclspec %s -o - | FileCheck %s --check-prefixes=CHECK,WI
2 // RUN: %clang_cc1 -emit-llvm -triple x86_64-scei-ps4 -fdeclspec %s -o - | FileCheck %s --check-prefixes=CHECK,PS4
4 #define JOIN2(x, y) x##y
5 #define JOIN(x, y) JOIN2(x, y)
6 #define UNIQ(name) JOIN(name, __LINE__)
7 #define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return &class::func; }
9 struct __declspec(dllexport
) s
{
13 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1saSERKS_
14 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1s1fEv
21 template class __declspec(dllexport
) c
<int>;
23 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiEaSERKS0_
24 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1cIiE1fEv
26 extern template class c
<char>;
27 template class __declspec(dllexport
) c
<char>;
29 // WI: define {{.*}} dllexport {{.*}} @_ZN1cIcEaSERKS0_
30 // WI: define {{.*}} dllexport {{.*}} @_ZN1cIcE1fEv
31 // PS4-NOT: @_ZN1cIcEaSERKS0_
32 // PS4: define weak_odr void @_ZN1cIcE1fEv
35 template class __declspec(dllexport
) c
<double>;
37 // WI: define {{.*}} dllexport {{.*}} @_ZN1cIdEaSERKS0_
38 // WI: define {{.*}} dllexport {{.*}} @_ZN1cIdE1fEv
39 // PS4-NOT: @_ZN1cIdEaSERKS0_
40 // PS4: define weak_odr void @_ZN1cIdE1fEv
50 template class __declspec(dllexport
) outer
<int>;
52 // CHECK: define {{.*}} dllexport {{.*}} @_ZN5outerIiE1fEv
53 // CHECK-NOT: define {{.*}} dllexport {{.*}} @_ZN5outerIiE5inner1fEv
55 extern template class __declspec(dllimport
) outer
<char>;
56 USEMEMFUNC(outer
<char>, f
)
57 USEMEMFUNC(outer
<char>::inner
, f
)
59 // CHECK-DAG: declare dllimport {{.*}} @_ZN5outerIcE1fEv
60 // WI-DAG: define {{.*}} @_ZN5outerIcE5inner1fEv
61 // PS4-DAG: declare {{.*}} @_ZN5outerIcE5inner1fEv