[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / windows-itanium-dllexport.cpp
blob6b30369e6835ccab9f7a09525cd52a67c2b699b9
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 {
10 void f() {}
13 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1saSERKS_
14 // CHECK: define {{.*}} dllexport {{.*}} @_ZN1s1fEv
16 template <class T>
17 class c {
18 void f() {}
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
34 c<double> g;
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
42 template <class T>
43 struct outer {
44 void f() {}
45 struct inner {
46 void f() {}
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