1 // RUN: %clang_cc1 -no-enable-noundef-analysis -disable-llvm-passes -triple i686-windows-msvc -fms-compatibility -emit-llvm -std=c++1y -O0 -o - %s -DMSABI | FileCheck --check-prefix=MSC --check-prefix=M32 %s
2 // RUN: %clang_cc1 -no-enable-noundef-analysis -disable-llvm-passes -triple x86_64-windows-msvc -fms-compatibility -emit-llvm -std=c++1y -O0 -o - %s -DMSABI | FileCheck --check-prefix=MSC --check-prefix=M64 %s
3 // RUN: %clang_cc1 -no-enable-noundef-analysis -disable-llvm-passes -triple i686-windows-gnu -emit-llvm -std=c++1y -O0 -o - %s | FileCheck --check-prefix=GNU --check-prefix=G32 %s
4 // RUN: %clang_cc1 -no-enable-noundef-analysis -disable-llvm-passes -triple x86_64-windows-gnu -emit-llvm -std=c++1y -O0 -o - %s | FileCheck --check-prefix=GNU --check-prefix=G64 %s
5 // RUN: %clang_cc1 -no-enable-noundef-analysis -disable-llvm-passes -triple i686-windows-msvc -fms-compatibility -emit-llvm -std=c++1y -O1 -o - %s -DMSABI | FileCheck --check-prefix=MO1 %s
6 // RUN: %clang_cc1 -no-enable-noundef-analysis -disable-llvm-passes -triple i686-windows-gnu -emit-llvm -std=c++1y -O1 -o - %s | FileCheck --check-prefix=GO1 %s
8 // Helper structs to make templates more expressive.
9 struct ImplicitInst_Imported
{};
10 struct ExplicitDecl_Imported
{};
11 struct ExplicitInst_Imported
{};
12 struct ExplicitSpec_Imported
{};
13 struct ExplicitSpec_Def_Imported
{};
14 struct ExplicitSpec_InlineDef_Imported
{};
15 struct ExplicitSpec_NotImported
{};
17 #define JOIN2(x, y) x##y
18 #define JOIN(x, y) JOIN2(x, y)
19 #define UNIQ(name) JOIN(name, __LINE__)
20 #define USE(func) void UNIQ(use)() { func(); }
21 #define USEMV(cls, var) int UNIQ(use)() { return ref(cls::var); }
22 #define USEMF(cls, fun) template<> void useMemFun<__LINE__, cls>() { cls().fun(); }
23 #define USESPECIALS(cls) void UNIQ(use)() { useSpecials<cls>(); }
26 T
ref(T
const& v
) { return v
; }
28 template<int Line
, typename T
>
33 T v
; // Default constructor
35 T
c1(static_cast<const T
&>(v
)); // Copy constructor
36 T c2
= static_cast<const T
&>(v
); // Copy constructor
38 c3
= static_cast<const T
&>(v
); // Copy assignment
40 T
m1(static_cast<T
&&>(v
)); // Move constructor
41 T m2
= static_cast<T
&&>(v
); // Move constructor
43 m3
= static_cast<T
&&>(v
); // Move assignment
46 // Used to force non-trivial special members.
47 struct __declspec(dllimport
) ForceNonTrivial
{
50 ForceNonTrivial(const ForceNonTrivial
&);
51 ForceNonTrivial
& operator=(const ForceNonTrivial
&);
52 ForceNonTrivial(ForceNonTrivial
&&);
53 ForceNonTrivial
& operator=(ForceNonTrivial
&&);
58 //===----------------------------------------------------------------------===//
60 //===----------------------------------------------------------------------===//
62 // Import individual members of a class.
63 struct ImportMembers
{
66 // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?normalDef@ImportMembers@@QAEXXZ"(ptr {{[^,]*}} %this)
67 // M64-DAG: define dso_local dllexport void @"?normalDef@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}} %this)
68 // M32-DAG: declare dllimport x86_thiscallcc void @"?normalDecl@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
69 // M64-DAG: declare dllimport void @"?normalDecl@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
70 // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInclass@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
71 // M64-DAG: declare dllimport void @"?normalInclass@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
72 // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInlineDef@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
73 // M64-DAG: declare dllimport void @"?normalInlineDef@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
74 // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInlineDecl@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
75 // M64-DAG: declare dllimport void @"?normalInlineDecl@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
76 // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ImportMembers9normalDefEv(ptr {{[^,]*}} %this)
77 // G64-DAG: define dso_local void @_ZN13ImportMembers9normalDefEv(ptr {{[^,]*}} %this)
78 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers10normalDeclEv(ptr {{[^,]*}})
79 // G64-DAG: declare dllimport void @_ZN13ImportMembers10normalDeclEv(ptr {{[^,]*}})
80 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv(ptr {{[^,]*}} %this)
81 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers13normalInclassEv(ptr {{[^,]*}} %this)
82 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv(ptr {{[^,]*}} %this)
83 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers15normalInlineDefEv(ptr {{[^,]*}} %this)
84 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv(ptr {{[^,]*}} %this)
85 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers16normalInlineDeclEv(ptr {{[^,]*}} %this)
86 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInclass@ImportMembers@@QAEXXZ"(
87 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInlineDef@ImportMembers@@QAEXXZ"(
88 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInlineDecl@ImportMembers@@QAEXXZ"(
89 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers13normalInclassEv(
90 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers15normalInlineDefEv(
91 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16normalInlineDeclEv(
92 __declspec(dllimport
) void normalDef(); // dllimport ignored
93 __declspec(dllimport
) void normalDecl();
94 __declspec(dllimport
) void normalInclass() {}
95 __declspec(dllimport
) void normalInlineDef();
96 __declspec(dllimport
) inline void normalInlineDecl();
98 // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?virtualDef@ImportMembers@@UAEXXZ"(ptr {{[^,]*}} %this)
99 // M64-DAG: define dso_local dllexport void @"?virtualDef@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}} %this)
100 // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualDecl@ImportMembers@@UAEXXZ"(ptr {{[^,]*}})
101 // M64-DAG: declare dllimport void @"?virtualDecl@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}})
102 // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInclass@ImportMembers@@UAEXXZ"(ptr {{[^,]*}})
103 // M64-DAG: declare dllimport void @"?virtualInclass@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}})
104 // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInlineDef@ImportMembers@@UAEXXZ"(ptr {{[^,]*}})
105 // M64-DAG: declare dllimport void @"?virtualInlineDef@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}})
106 // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInlineDecl@ImportMembers@@UAEXXZ"(ptr {{[^,]*}})
107 // M64-DAG: declare dllimport void @"?virtualInlineDecl@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}})
108 // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ImportMembers10virtualDefEv(ptr {{[^,]*}} %this)
109 // G64-DAG: define dso_local void @_ZN13ImportMembers10virtualDefEv(ptr {{[^,]*}} %this)
110 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers11virtualDeclEv(ptr {{[^,]*}})
111 // G64-DAG: declare dllimport void @_ZN13ImportMembers11virtualDeclEv(ptr {{[^,]*}})
112 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv(ptr {{[^,]*}} %this)
113 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers14virtualInclassEv(ptr {{[^,]*}} %this)
114 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv(ptr {{[^,]*}} %this)
115 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers16virtualInlineDefEv(ptr {{[^,]*}} %this)
116 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv(ptr {{[^,]*}} %this)
117 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers17virtualInlineDeclEv(ptr {{[^,]*}} %this)
118 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInclass@ImportMembers@@UAEXXZ"(
119 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInlineDef@ImportMembers@@UAEXXZ"(
120 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInlineDecl@ImportMembers@@UAEXXZ"(
121 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers14virtualInclassEv(
122 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers16virtualInlineDefEv(
123 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers17virtualInlineDeclEv(
124 __declspec(dllimport
) virtual void virtualDef(); // dllimport ignored
125 __declspec(dllimport
) virtual void virtualDecl();
126 __declspec(dllimport
) virtual void virtualInclass() {}
127 __declspec(dllimport
) virtual void virtualInlineDef();
128 __declspec(dllimport
) virtual inline void virtualInlineDecl();
130 // MSC-DAG: define dso_local dllexport void @"?staticDef@ImportMembers@@SAXXZ"()
131 // MSC-DAG: declare dllimport void @"?staticDecl@ImportMembers@@SAXXZ"()
132 // MSC-DAG: declare dllimport void @"?staticInclass@ImportMembers@@SAXXZ"()
133 // MSC-DAG: declare dllimport void @"?staticInlineDef@ImportMembers@@SAXXZ"()
134 // MSC-DAG: declare dllimport void @"?staticInlineDecl@ImportMembers@@SAXXZ"()
135 // GNU-DAG: define dso_local void @_ZN13ImportMembers9staticDefEv()
136 // GNU-DAG: declare dllimport void @_ZN13ImportMembers10staticDeclEv()
137 // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers13staticInclassEv()
138 // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers15staticInlineDefEv()
139 // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers16staticInlineDeclEv()
140 // MO1-DAG: define available_externally dllimport void @"?staticInclass@ImportMembers@@SAXXZ"()
141 // MO1-DAG: define available_externally dllimport void @"?staticInlineDef@ImportMembers@@SAXXZ"()
142 // MO1-DAG: define available_externally dllimport void @"?staticInlineDecl@ImportMembers@@SAXXZ"()
143 // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers13staticInclassEv()
144 // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers15staticInlineDefEv()
145 // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers16staticInlineDeclEv()
146 __declspec(dllimport
) static void staticDef(); // dllimport ignored
147 __declspec(dllimport
) static void staticDecl();
148 __declspec(dllimport
) static void staticInclass() {}
149 __declspec(dllimport
) static void staticInlineDef();
150 __declspec(dllimport
) static inline void staticInlineDecl();
152 // M32-DAG: declare dllimport x86_thiscallcc void @"?protectedNormalDecl@ImportMembers@@IAEXXZ"(ptr {{[^,]*}})
153 // M64-DAG: declare dllimport void @"?protectedNormalDecl@ImportMembers@@IEAAXXZ"(ptr {{[^,]*}})
154 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers19protectedNormalDeclEv(ptr {{[^,]*}})
155 // G64-DAG: declare dllimport void @_ZN13ImportMembers19protectedNormalDeclEv(ptr {{[^,]*}})
156 // MSC-DAG: declare dllimport void @"?protectedStaticDecl@ImportMembers@@KAXXZ"()
157 // GNU-DAG: declare dllimport void @_ZN13ImportMembers19protectedStaticDeclEv()
159 __declspec(dllimport
) void protectedNormalDecl();
160 __declspec(dllimport
) static void protectedStaticDecl();
162 // M32-DAG: declare dllimport x86_thiscallcc void @"?privateNormalDecl@ImportMembers@@AAEXXZ"(ptr {{[^,]*}})
163 // M64-DAG: declare dllimport void @"?privateNormalDecl@ImportMembers@@AEAAXXZ"(ptr {{[^,]*}})
164 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers17privateNormalDeclEv(ptr {{[^,]*}})
165 // G64-DAG: declare dllimport void @_ZN13ImportMembers17privateNormalDeclEv(ptr {{[^,]*}})
166 // MSC-DAG: declare dllimport void @"?privateStaticDecl@ImportMembers@@CAXXZ"()
167 // GNU-DAG: declare dllimport void @_ZN13ImportMembers17privateStaticDeclEv()
169 __declspec(dllimport
) void privateNormalDecl();
170 __declspec(dllimport
) static void privateStaticDecl();
172 // M32-DAG: declare dso_local x86_thiscallcc void @"?ignored@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
173 // M64-DAG: declare dso_local void @"?ignored@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
174 // G32-DAG: declare dso_local x86_thiscallcc void @_ZN13ImportMembers7ignoredEv(ptr {{[^,]*}})
175 // G64-DAG: declare dso_local void @_ZN13ImportMembers7ignoredEv(ptr {{[^,]*}})
179 // MSC-DAG: @"?StaticField@ImportMembers@@2HA" = external dllimport global i32
180 // MSC-DAG: @"?StaticConstField@ImportMembers@@2HB" = external dllimport constant i32
181 // MSC-DAG: @"?StaticConstFieldEqualInit@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4
182 // MSC-DAG: @"?StaticConstFieldBraceInit@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4
183 // MSC-DAG: @"?ConstexprField@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4
184 // GNU-DAG: @_ZN13ImportMembers11StaticFieldE = external dllimport global i32
185 // GNU-DAG: @_ZN13ImportMembers16StaticConstFieldE = external dllimport constant i32
186 // GNU-DAG: @_ZN13ImportMembers25StaticConstFieldEqualInitE = external dllimport constant i32
187 // GNU-DAG: @_ZN13ImportMembers25StaticConstFieldBraceInitE = external dllimport constant i32
188 // GNU-DAG: @_ZN13ImportMembers14ConstexprFieldE = external dllimport constant i32
189 __declspec(dllimport
) static int StaticField
;
190 __declspec(dllimport
) static const int StaticConstField
;
191 __declspec(dllimport
) static const int StaticConstFieldEqualInit
= 1;
192 __declspec(dllimport
) static const int StaticConstFieldBraceInit
{1};
193 __declspec(dllimport
) constexpr static int ConstexprField
= 1;
195 template<int Line
, typename T
> friend void useMemFun();
198 void ImportMembers::normalDef() {} // dllimport ignored
199 inline void ImportMembers::normalInlineDef() {}
200 void ImportMembers::normalInlineDecl() {}
201 void ImportMembers::virtualDef() {} // dllimport ignored
202 inline void ImportMembers::virtualInlineDef() {}
203 void ImportMembers::virtualInlineDecl() {}
204 void ImportMembers::staticDef() {} // dllimport ignored
205 inline void ImportMembers::staticInlineDef() {}
206 void ImportMembers::staticInlineDecl() {}
208 USEMF(ImportMembers
, normalDef
)
209 USEMF(ImportMembers
, normalDecl
)
210 USEMF(ImportMembers
, normalInclass
)
211 USEMF(ImportMembers
, normalInlineDef
)
212 USEMF(ImportMembers
, normalInlineDecl
)
213 USEMF(ImportMembers
, virtualDef
)
214 USEMF(ImportMembers
, virtualDecl
)
215 USEMF(ImportMembers
, virtualInclass
)
216 USEMF(ImportMembers
, virtualInlineDef
)
217 USEMF(ImportMembers
, virtualInlineDecl
)
218 USEMF(ImportMembers
, staticDef
)
219 USEMF(ImportMembers
, staticDecl
)
220 USEMF(ImportMembers
, staticInclass
)
221 USEMF(ImportMembers
, staticInlineDef
)
222 USEMF(ImportMembers
, staticInlineDecl
)
223 USEMF(ImportMembers
, protectedNormalDecl
)
224 USEMF(ImportMembers
, protectedStaticDecl
)
225 USEMF(ImportMembers
, privateNormalDecl
)
226 USEMF(ImportMembers
, privateStaticDecl
)
227 USEMF(ImportMembers
, ignored
)
229 USEMV(ImportMembers
, StaticField
)
230 USEMV(ImportMembers
, StaticConstField
)
231 USEMV(ImportMembers
, StaticConstFieldEqualInit
)
232 USEMV(ImportMembers
, StaticConstFieldBraceInit
)
233 USEMV(ImportMembers
, ConstexprField
)
236 // Import individual members of a nested class.
237 struct ImportMembers::Nested
{
238 // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?normalDef@Nested@ImportMembers@@QAEXXZ"(ptr {{[^,]*}} %this)
239 // M64-DAG: define dso_local dllexport void @"?normalDef@Nested@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}} %this)
240 // M32-DAG: declare dllimport x86_thiscallcc void @"?normalDecl@Nested@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
241 // M64-DAG: declare dllimport void @"?normalDecl@Nested@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
242 // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInclass@Nested@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
243 // M64-DAG: declare dllimport void @"?normalInclass@Nested@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
244 // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInlineDef@Nested@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
245 // M64-DAG: declare dllimport void @"?normalInlineDef@Nested@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
246 // M32-DAG: declare dllimport x86_thiscallcc void @"?normalInlineDecl@Nested@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
247 // M64-DAG: declare dllimport void @"?normalInlineDecl@Nested@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
248 // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested9normalDefEv(ptr {{[^,]*}} %this)
249 // G64-DAG: define dso_local void @_ZN13ImportMembers6Nested9normalDefEv(ptr {{[^,]*}} %this)
250 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers6Nested10normalDeclEv(ptr {{[^,]*}})
251 // G64-DAG: declare dllimport void @_ZN13ImportMembers6Nested10normalDeclEv(ptr {{[^,]*}})
252 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv(ptr {{[^,]*}} %this)
253 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested13normalInclassEv(ptr {{[^,]*}} %this)
254 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv(ptr {{[^,]*}} %this)
255 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested15normalInlineDefEv(ptr {{[^,]*}} %this)
256 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv(ptr {{[^,]*}} %this)
257 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested16normalInlineDeclEv(ptr {{[^,]*}} %this)
258 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInclass@Nested@ImportMembers@@QAEXXZ"(
259 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInlineDef@Nested@ImportMembers@@QAEXXZ"(
260 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?normalInlineDecl@Nested@ImportMembers@@QAEXXZ"(
261 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested13normalInclassEv(
262 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested15normalInlineDefEv(
263 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16normalInlineDeclEv(
264 __declspec(dllimport
) void normalDef(); // dllimport ignored
265 __declspec(dllimport
) void normalDecl();
266 __declspec(dllimport
) void normalInclass() {}
267 __declspec(dllimport
) void normalInlineDef();
268 __declspec(dllimport
) inline void normalInlineDecl();
270 // M32-DAG: define dso_local dllexport x86_thiscallcc void @"?virtualDef@Nested@ImportMembers@@UAEXXZ"(ptr {{[^,]*}} %this)
271 // M64-DAG: define dso_local dllexport void @"?virtualDef@Nested@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}} %this)
272 // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualDecl@Nested@ImportMembers@@UAEXXZ"(ptr {{[^,]*}})
273 // M64-DAG: declare dllimport void @"?virtualDecl@Nested@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}})
274 // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInclass@Nested@ImportMembers@@UAEXXZ"(ptr {{[^,]*}})
275 // M64-DAG: declare dllimport void @"?virtualInclass@Nested@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}})
276 // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInlineDef@Nested@ImportMembers@@UAEXXZ"(ptr {{[^,]*}})
277 // M64-DAG: declare dllimport void @"?virtualInlineDef@Nested@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}})
278 // M32-DAG: declare dllimport x86_thiscallcc void @"?virtualInlineDecl@Nested@ImportMembers@@UAEXXZ"(ptr {{[^,]*}})
279 // M64-DAG: declare dllimport void @"?virtualInlineDecl@Nested@ImportMembers@@UEAAXXZ"(ptr {{[^,]*}})
280 // G32-DAG: define dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested10virtualDefEv(ptr {{[^,]*}} %this)
281 // G64-DAG: define dso_local void @_ZN13ImportMembers6Nested10virtualDefEv(ptr {{[^,]*}} %this)
282 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers6Nested11virtualDeclEv(ptr {{[^,]*}})
283 // G64-DAG: declare dllimport void @_ZN13ImportMembers6Nested11virtualDeclEv(ptr {{[^,]*}})
284 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested14virtualInclassEv(ptr {{[^,]*}} %this)
285 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested14virtualInclassEv(ptr {{[^,]*}} %this)
286 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16virtualInlineDefEv(ptr {{[^,]*}} %this)
287 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested16virtualInlineDefEv(ptr {{[^,]*}} %this)
288 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(ptr {{[^,]*}} %this)
289 // G64-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(ptr {{[^,]*}} %this)
291 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInclass@Nested@ImportMembers@@UAEXXZ"(
292 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInlineDef@Nested@ImportMembers@@UAEXXZ"(
293 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"?virtualInlineDecl@Nested@ImportMembers@@UAEXXZ"(
294 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested14virtualInclassEv(
295 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested16virtualInlineDefEv(
296 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested17virtualInlineDeclEv(
297 __declspec(dllimport
) virtual void virtualDef(); // dllimport ignored
298 __declspec(dllimport
) virtual void virtualDecl();
299 __declspec(dllimport
) virtual void virtualInclass() {}
300 __declspec(dllimport
) virtual void virtualInlineDef();
301 __declspec(dllimport
) virtual inline void virtualInlineDecl();
303 // MSC-DAG: define dso_local dllexport void @"?staticDef@Nested@ImportMembers@@SAXXZ"()
304 // MSC-DAG: declare dllimport void @"?staticDecl@Nested@ImportMembers@@SAXXZ"()
305 // MSC-DAG: declare dllimport void @"?staticInclass@Nested@ImportMembers@@SAXXZ"()
306 // MSC-DAG: declare dllimport void @"?staticInlineDef@Nested@ImportMembers@@SAXXZ"()
307 // MSC-DAG: declare dllimport void @"?staticInlineDecl@Nested@ImportMembers@@SAXXZ"()
308 // GNU-DAG: define dso_local void @_ZN13ImportMembers6Nested9staticDefEv()
309 // GNU-DAG: declare dllimport void @_ZN13ImportMembers6Nested10staticDeclEv()
310 // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested13staticInclassEv()
311 // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested15staticInlineDefEv()
312 // GNU-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested16staticInlineDeclEv()
313 // MO1-DAG: define available_externally dllimport void @"?staticInclass@Nested@ImportMembers@@SAXXZ"()
314 // MO1-DAG: define available_externally dllimport void @"?staticInlineDef@Nested@ImportMembers@@SAXXZ"()
315 // MO1-DAG: define available_externally dllimport void @"?staticInlineDecl@Nested@ImportMembers@@SAXXZ"()
316 // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested13staticInclassEv()
317 // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested15staticInlineDefEv()
318 // GO1-DAG: define linkonce_odr dso_local void @_ZN13ImportMembers6Nested16staticInlineDeclEv()
319 __declspec(dllimport
) static void staticDef(); // dllimport ignored
320 __declspec(dllimport
) static void staticDecl();
321 __declspec(dllimport
) static void staticInclass() {}
322 __declspec(dllimport
) static void staticInlineDef();
323 __declspec(dllimport
) static inline void staticInlineDecl();
325 // M32-DAG: declare dllimport x86_thiscallcc void @"?protectedNormalDecl@Nested@ImportMembers@@IAEXXZ"(ptr {{[^,]*}})
326 // M64-DAG: declare dllimport void @"?protectedNormalDecl@Nested@ImportMembers@@IEAAXXZ"(ptr {{[^,]*}})
327 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers6Nested19protectedNormalDeclEv(ptr {{[^,]*}}
328 // G64-DAG: declare dllimport void @_ZN13ImportMembers6Nested19protectedNormalDeclEv(ptr {{[^,]*}})
329 // MSC-DAG: declare dllimport void @"?protectedStaticDecl@Nested@ImportMembers@@KAXXZ"()
330 // GNU-DAG: declare dllimport void @_ZN13ImportMembers6Nested19protectedStaticDeclEv()
332 __declspec(dllimport
) void protectedNormalDecl();
333 __declspec(dllimport
) static void protectedStaticDecl();
335 // M32-DAG: declare dllimport x86_thiscallcc void @"?privateNormalDecl@Nested@ImportMembers@@AAEXXZ"(ptr {{[^,]*}})
336 // M64-DAG: declare dllimport void @"?privateNormalDecl@Nested@ImportMembers@@AEAAXXZ"(ptr {{[^,]*}})
337 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN13ImportMembers6Nested17privateNormalDeclEv(ptr {{[^,]*}})
338 // G64-DAG: declare dllimport void @_ZN13ImportMembers6Nested17privateNormalDeclEv(ptr {{[^,]*}})
339 // MSC-DAG: declare dllimport void @"?privateStaticDecl@Nested@ImportMembers@@CAXXZ"()
340 // GNU-DAG: declare dllimport void @_ZN13ImportMembers6Nested17privateStaticDeclEv()
342 __declspec(dllimport
) void privateNormalDecl();
343 __declspec(dllimport
) static void privateStaticDecl();
345 // M32-DAG: declare dso_local x86_thiscallcc void @"?ignored@Nested@ImportMembers@@QAEXXZ"(ptr {{[^,]*}})
346 // M64-DAG: declare dso_local void @"?ignored@Nested@ImportMembers@@QEAAXXZ"(ptr {{[^,]*}})
347 // G32-DAG: declare dso_local x86_thiscallcc void @_ZN13ImportMembers6Nested7ignoredEv(ptr {{[^,]*}})
348 // G64-DAG: declare dso_local void @_ZN13ImportMembers6Nested7ignoredEv(ptr {{[^,]*}})
352 // MSC-DAG: @"?StaticField@Nested@ImportMembers@@2HA" = external dllimport global i32
353 // MSC-DAG: @"?StaticConstField@Nested@ImportMembers@@2HB" = external dllimport constant i32
354 // MSC-DAG: @"?StaticConstFieldEqualInit@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4
355 // MSC-DAG: @"?StaticConstFieldBraceInit@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4
356 // MSC-DAG: @"?ConstexprField@Nested@ImportMembers@@2HB" = available_externally dllimport constant i32 1, align 4
357 // GNU-DAG: @_ZN13ImportMembers6Nested11StaticFieldE = external dllimport global i32
358 // GNU-DAG: @_ZN13ImportMembers6Nested16StaticConstFieldE = external dllimport constant i32
359 // GNU-DAG: @_ZN13ImportMembers6Nested25StaticConstFieldEqualInitE = external dllimport constant i32
360 // GNU-DAG: @_ZN13ImportMembers6Nested25StaticConstFieldBraceInitE = external dllimport constant i32
361 // GNU-DAG: @_ZN13ImportMembers6Nested14ConstexprFieldE = external dllimport constant i32
362 __declspec(dllimport
) static int StaticField
;
363 __declspec(dllimport
) static const int StaticConstField
;
364 __declspec(dllimport
) static const int StaticConstFieldEqualInit
= 1;
365 __declspec(dllimport
) static const int StaticConstFieldBraceInit
{1};
366 __declspec(dllimport
) constexpr static int ConstexprField
= 1;
368 template<int Line
, typename T
> friend void useMemFun();
371 void ImportMembers::Nested::normalDef() {} // dllimport ignored
372 inline void ImportMembers::Nested::normalInlineDef() {}
373 void ImportMembers::Nested::normalInlineDecl() {}
374 void ImportMembers::Nested::virtualDef() {} // dllimport ignored
375 inline void ImportMembers::Nested::virtualInlineDef() {}
376 void ImportMembers::Nested::virtualInlineDecl() {}
377 void ImportMembers::Nested::staticDef() {} // dllimport ignored
378 inline void ImportMembers::Nested::staticInlineDef() {}
379 void ImportMembers::Nested::staticInlineDecl() {}
381 USEMF(ImportMembers::Nested
, normalDef
)
382 USEMF(ImportMembers::Nested
, normalDecl
)
383 USEMF(ImportMembers::Nested
, normalInclass
)
384 USEMF(ImportMembers::Nested
, normalInlineDef
)
385 USEMF(ImportMembers::Nested
, normalInlineDecl
)
386 USEMF(ImportMembers::Nested
, virtualDef
)
387 USEMF(ImportMembers::Nested
, virtualDecl
)
388 USEMF(ImportMembers::Nested
, virtualInclass
)
389 USEMF(ImportMembers::Nested
, virtualInlineDef
)
390 USEMF(ImportMembers::Nested
, virtualInlineDecl
)
391 USEMF(ImportMembers::Nested
, staticDef
)
392 USEMF(ImportMembers::Nested
, staticDecl
)
393 USEMF(ImportMembers::Nested
, staticInclass
)
394 USEMF(ImportMembers::Nested
, staticInlineDef
)
395 USEMF(ImportMembers::Nested
, staticInlineDecl
)
396 USEMF(ImportMembers::Nested
, protectedNormalDecl
)
397 USEMF(ImportMembers::Nested
, protectedStaticDecl
)
398 USEMF(ImportMembers::Nested
, privateNormalDecl
)
399 USEMF(ImportMembers::Nested
, privateStaticDecl
)
400 USEMF(ImportMembers::Nested
, ignored
)
402 USEMV(ImportMembers::Nested
, StaticField
)
403 USEMV(ImportMembers::Nested
, StaticConstField
)
404 USEMV(ImportMembers::Nested
, StaticConstFieldEqualInit
)
405 USEMV(ImportMembers::Nested
, StaticConstFieldBraceInit
)
406 USEMV(ImportMembers::Nested
, ConstexprField
)
409 // Import special member functions.
410 struct ImportSpecials
{
411 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportSpecials@@QAE@XZ"(ptr {{[^,]*}} returned {{[^,]*}})
412 // M64-DAG: declare dllimport ptr @"??0ImportSpecials@@QEAA@XZ"(ptr {{[^,]*}} returned {{[^,]*}})
413 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN14ImportSpecialsC1Ev(ptr {{[^,]*}})
414 // G64-DAG: declare dllimport void @_ZN14ImportSpecialsC1Ev(ptr {{[^,]*}})
415 __declspec(dllimport
) ImportSpecials();
417 // M32-DAG: declare dllimport x86_thiscallcc void @"??1ImportSpecials@@QAE@XZ"(ptr {{[^,]*}})
418 // M64-DAG: declare dllimport void @"??1ImportSpecials@@QEAA@XZ"(ptr {{[^,]*}})
419 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN14ImportSpecialsD1Ev(ptr {{[^,]*}})
420 // G64-DAG: declare dllimport void @_ZN14ImportSpecialsD1Ev(ptr {{[^,]*}})
421 __declspec(dllimport
) ~ImportSpecials();
423 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportSpecials@@QAE@ABU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
424 // M64-DAG: declare dllimport ptr @"??0ImportSpecials@@QEAA@AEBU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
425 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN14ImportSpecialsC1ERKS_(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
426 // G64-DAG: declare dllimport void @_ZN14ImportSpecialsC1ERKS_(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
427 __declspec(dllimport
) ImportSpecials(const ImportSpecials
&);
429 // M32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportSpecials@@QAEAAU0@ABU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
430 // M64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportSpecials@@QEAAAEAU0@AEBU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
431 // G32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN14ImportSpecialsaSERKS_(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
432 // G64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN14ImportSpecialsaSERKS_(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
433 __declspec(dllimport
) ImportSpecials
& operator=(const ImportSpecials
&);
435 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportSpecials@@QAE@$$QAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
436 // M64-DAG: declare dllimport ptr @"??0ImportSpecials@@QEAA@$$QEAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
437 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN14ImportSpecialsC1EOS_(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
438 // G64-DAG: declare dllimport void @_ZN14ImportSpecialsC1EOS_(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
439 __declspec(dllimport
) ImportSpecials(ImportSpecials
&&);
441 // M32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportSpecials@@QAEAAU0@$$QAU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
442 // M64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
443 // G32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN14ImportSpecialsaSEOS_(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
444 // G64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN14ImportSpecialsaSEOS_(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
445 __declspec(dllimport
) ImportSpecials
& operator=(ImportSpecials
&&);
447 USESPECIALS(ImportSpecials
)
450 // Export inline special member functions.
451 struct ImportInlineSpecials
{
452 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportInlineSpecials@@QAE@XZ"(ptr {{[^,]*}} returned {{[^,]*}})
453 // M64-DAG: declare dllimport ptr @"??0ImportInlineSpecials@@QEAA@XZ"(ptr {{[^,]*}} returned {{[^,]*}})
454 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev(ptr {{[^,]*}} %this)
455 // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1Ev(ptr {{[^,]*}} %this)
456 // MO1-DAG: define available_externally dllimport x86_thiscallcc ptr @"??0ImportInlineSpecials@@QAE@XZ"(
457 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1Ev(
458 __declspec(dllimport
) ImportInlineSpecials() {}
460 // M32-DAG: declare dllimport x86_thiscallcc void @"??1ImportInlineSpecials@@QAE@XZ"(ptr {{[^,]*}})
461 // M64-DAG: declare dllimport void @"??1ImportInlineSpecials@@QEAA@XZ"(ptr {{[^,]*}})
462 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev(ptr {{[^,]*}} %this)
463 // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsD1Ev(ptr {{[^,]*}} %this)
464 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"??1ImportInlineSpecials@@QAE@XZ"(
465 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsD1Ev(
466 __declspec(dllimport
) ~ImportInlineSpecials() {}
468 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportInlineSpecials@@QAE@ABU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
469 // M64-DAG: declare dllimport ptr @"??0ImportInlineSpecials@@QEAA@AEBU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
470 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
471 // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1ERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
472 // MO1-DAG: define available_externally dllimport x86_thiscallcc ptr @"??0ImportInlineSpecials@@QAE@ABU0@@Z"(
473 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(
474 __declspec(dllimport
) inline ImportInlineSpecials(const ImportInlineSpecials
&);
476 // M32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportInlineSpecials@@QAEAAU0@ABU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
477 // M64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportInlineSpecials@@QEAAAEAU0@AEBU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
478 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN20ImportInlineSpecialsaSERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
479 // G64-DAG: define linkonce_odr dso_local nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN20ImportInlineSpecialsaSERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
480 // MO1-DAG: define available_externally dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportInlineSpecials@@QAEAAU0@ABU0@@Z"(
481 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN20ImportInlineSpecialsaSERKS_(
482 __declspec(dllimport
) ImportInlineSpecials
& operator=(const ImportInlineSpecials
&);
484 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportInlineSpecials@@QAE@$$QAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
485 // M64-DAG: declare dllimport ptr @"??0ImportInlineSpecials@@QEAA@$$QEAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
486 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
487 // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
488 // MO1-DAG: define available_externally dllimport x86_thiscallcc ptr @"??0ImportInlineSpecials@@QAE@$$QAU0@@Z"(
489 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(
490 __declspec(dllimport
) ImportInlineSpecials(ImportInlineSpecials
&&) {}
492 // M32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
493 // M64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
494 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN20ImportInlineSpecialsaSEOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
495 // G64-DAG: define linkonce_odr dso_local nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN20ImportInlineSpecialsaSEOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
496 // MO1-DAG: define available_externally dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(
497 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN20ImportInlineSpecialsaSEOS_(
498 __declspec(dllimport
) ImportInlineSpecials
& operator=(ImportInlineSpecials
&&) { return *this; }
500 ImportInlineSpecials::ImportInlineSpecials(const ImportInlineSpecials
&) {}
501 inline ImportInlineSpecials
& ImportInlineSpecials::operator=(const ImportInlineSpecials
&) { return *this; }
502 USESPECIALS(ImportInlineSpecials
)
505 // Import defaulted member functions.
506 struct ImportDefaulted
{
507 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportDefaulted@@QAE@XZ"(ptr {{[^,]*}} returned {{[^,]*}})
508 // M64-DAG: declare dllimport ptr @"??0ImportDefaulted@@QEAA@XZ"(ptr {{[^,]*}} returned {{[^,]*}})
509 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1Ev(ptr {{[^,]*}} %this)
510 // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1Ev(ptr {{[^,]*}} %this)
511 // MO1-DAG: define available_externally dllimport x86_thiscallcc ptr @"??0ImportDefaulted@@QAE@XZ"(ptr {{[^,]*}} returned {{[^,]*}} %this)
512 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1Ev(ptr {{[^,]*}} %this)
513 __declspec(dllimport
) ImportDefaulted() = default;
515 // M32-DAG: declare dllimport x86_thiscallcc void @"??1ImportDefaulted@@QAE@XZ"(ptr {{[^,]*}})
516 // M64-DAG: declare dllimport void @"??1ImportDefaulted@@QEAA@XZ"(ptr {{[^,]*}})
517 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(ptr {{[^,]*}} %this)
518 // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedD1Ev(ptr {{[^,]*}} %this)
519 // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"??1ImportDefaulted@@QAE@XZ"(ptr {{[^,]*}} %this)
520 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedD1Ev(ptr {{[^,]*}} %this)
521 __declspec(dllimport
) ~ImportDefaulted() = default;
523 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportDefaulted@@QAE@ABU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
524 // M64-DAG: declare dllimport ptr @"??0ImportDefaulted@@QEAA@AEBU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
525 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
526 // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1ERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
527 // MO1-DAG: define available_externally dllimport x86_thiscallcc ptr @"??0ImportDefaulted@@QAE@ABU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
528 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
529 __declspec(dllimport
) ImportDefaulted(const ImportDefaulted
&) = default;
531 // M32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
532 // M64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaulted@@QEAAAEAU0@AEBU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
533 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN15ImportDefaultedaSERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
534 // G64-DAG: define linkonce_odr dso_local nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN15ImportDefaultedaSERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
535 // MO1-DAG: define available_externally dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
536 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN15ImportDefaultedaSERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
537 __declspec(dllimport
) ImportDefaulted
& operator=(const ImportDefaulted
&) = default;
539 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportDefaulted@@QAE@$$QAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
540 // M64-DAG: declare dllimport ptr @"??0ImportDefaulted@@QEAA@$$QEAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
541 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
542 // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
543 // MO1-DAG: define available_externally dllimport x86_thiscallcc ptr @"??0ImportDefaulted@@QAE@$$QAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
544 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
545 __declspec(dllimport
) ImportDefaulted(ImportDefaulted
&&) = default;
547 // M32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
548 // M64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaulted@@QEAAAEAU0@$$QEAU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
549 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN15ImportDefaultedaSEOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
550 // G64-DAG: define linkonce_odr dso_local nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN15ImportDefaultedaSEOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
551 // MO1-DAG: define available_externally dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
552 // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN15ImportDefaultedaSEOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
553 __declspec(dllimport
) ImportDefaulted
& operator=(ImportDefaulted
&&) = default;
555 ForceNonTrivial v
; // ensure special members are non-trivial
557 USESPECIALS(ImportDefaulted
)
560 // Import defaulted member function definitions.
561 struct ImportDefaultedDefs
{
562 __declspec(dllimport
) inline ImportDefaultedDefs();
563 __declspec(dllimport
) inline ~ImportDefaultedDefs();
565 __declspec(dllimport
) ImportDefaultedDefs(const ImportDefaultedDefs
&);
566 __declspec(dllimport
) ImportDefaultedDefs
& operator=(const ImportDefaultedDefs
&);
568 __declspec(dllimport
) ImportDefaultedDefs(ImportDefaultedDefs
&&);
569 __declspec(dllimport
) ImportDefaultedDefs
& operator=(ImportDefaultedDefs
&&);
573 // For MinGW, the function will not be dllimport, and we cannot add the attribute now.
574 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportDefaultedDefs@@QAE@XZ"(ptr {{[^,]*}} returned {{[^,]*}})
575 // M64-DAG: declare dllimport ptr @"??0ImportDefaultedDefs@@QEAA@XZ"(ptr {{[^,]*}} returned {{[^,]*}})
576 __declspec(dllimport
) ImportDefaultedDefs::ImportDefaultedDefs() = default;
580 // For MinGW, the function will not be dllimport, and we cannot add the attribute now.
581 // M32-DAG: declare dllimport x86_thiscallcc void @"??1ImportDefaultedDefs@@QAE@XZ"(ptr {{[^,]*}})
582 // M64-DAG: declare dllimport void @"??1ImportDefaultedDefs@@QEAA@XZ"(ptr {{[^,]*}})
583 __declspec(dllimport
) ImportDefaultedDefs::~ImportDefaultedDefs() = default;
586 // M32-DAG: declare dllimport x86_thiscallcc ptr @"??0ImportDefaultedDefs@@QAE@ABU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
587 // M64-DAG: declare dllimport ptr @"??0ImportDefaultedDefs@@QEAA@AEBU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
588 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1ERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
589 // G64-DAG: define linkonce_odr dso_local void @_ZN19ImportDefaultedDefsC1ERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
590 inline ImportDefaultedDefs::ImportDefaultedDefs(const ImportDefaultedDefs
&) = default;
592 // M32-DAG: declare dllimport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaultedDefs@@QAEAAU0@ABU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
593 // M64-DAG: declare dllimport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaultedDefs@@QEAAAEAU0@AEBU0@@Z"(ptr {{[^,]*}}, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}))
594 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN19ImportDefaultedDefsaSERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
595 // G64-DAG: define linkonce_odr dso_local nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN19ImportDefaultedDefsaSERKS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
596 inline ImportDefaultedDefs
& ImportDefaultedDefs::operator=(const ImportDefaultedDefs
&) = default;
598 // M32-DAG: define dso_local dllexport x86_thiscallcc ptr @"??0ImportDefaultedDefs@@QAE@$$QAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
599 // M64-DAG: define dso_local dllexport ptr @"??0ImportDefaultedDefs@@QEAA@$$QEAU0@@Z"(ptr {{[^,]*}} returned {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
600 // G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
601 // G64-DAG: define dso_local void @_ZN19ImportDefaultedDefsC1EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
602 // G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC2EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
603 // G64-DAG: define dso_local void @_ZN19ImportDefaultedDefsC2EOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
604 ImportDefaultedDefs::ImportDefaultedDefs(ImportDefaultedDefs
&&) = default; // dllimport ignored
606 // M32-DAG: define dso_local dllexport x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
607 // M64-DAG: define dso_local dllexport nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @"??4ImportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
608 // G32-DAG: define dso_local x86_thiscallcc nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN19ImportDefaultedDefsaSEOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
609 // G64-DAG: define dso_local nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZN19ImportDefaultedDefsaSEOS_(ptr {{[^,]*}} %this, ptr nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0)
610 ImportDefaultedDefs
& ImportDefaultedDefs::operator=(ImportDefaultedDefs
&&) = default; // dllimport ignored
612 USESPECIALS(ImportDefaultedDefs
)
615 // Import allocation functions.
617 __declspec(dllimport
) void* operator new(__SIZE_TYPE__
);
618 __declspec(dllimport
) void* operator new[](__SIZE_TYPE__
);
619 __declspec(dllimport
) void operator delete(void*);
620 __declspec(dllimport
) void operator delete[](void*);
623 // M32-DAG: declare dllimport ptr @"??2ImportAlloc@@SAPAXI@Z"(i32)
624 // M64-DAG: declare dllimport ptr @"??2ImportAlloc@@SAPEAX_K@Z"(i64)
625 // G32-DAG: declare dllimport ptr @_ZN11ImportAllocnwEj(i32)
626 // G64-DAG: declare dllimport ptr @_ZN11ImportAllocnwEy(i64)
627 void UNIQ(use
)() { new ImportAlloc(); }
629 // M32-DAG: declare dllimport ptr @"??_UImportAlloc@@SAPAXI@Z"(i32)
630 // M64-DAG: declare dllimport ptr @"??_UImportAlloc@@SAPEAX_K@Z"(i64)
631 // G32-DAG: declare dllimport ptr @_ZN11ImportAllocnaEj(i32)
632 // G64-DAG: declare dllimport ptr @_ZN11ImportAllocnaEy(i64)
633 void UNIQ(use
)() { new ImportAlloc
[1]; }
635 // M32-DAG: declare dllimport void @"??3ImportAlloc@@SAXPAX@Z"(ptr)
636 // M64-DAG: declare dllimport void @"??3ImportAlloc@@SAXPEAX@Z"(ptr)
637 // G32-DAG: declare dllimport void @_ZN11ImportAllocdlEPv(ptr)
638 // G64-DAG: declare dllimport void @_ZN11ImportAllocdlEPv(ptr)
639 void UNIQ(use
)(ImportAlloc
* ptr
) { delete ptr
; }
641 // M32-DAG: declare dllimport void @"??_VImportAlloc@@SAXPAX@Z"(ptr)
642 // M64-DAG: declare dllimport void @"??_VImportAlloc@@SAXPEAX@Z"(ptr)
643 // G32-DAG: declare dllimport void @_ZN11ImportAllocdaEPv(ptr)
644 // G64-DAG: declare dllimport void @_ZN11ImportAllocdaEPv(ptr)
645 void UNIQ(use
)(ImportAlloc
* ptr
) { delete[] ptr
; }
648 //===----------------------------------------------------------------------===//
649 // Class member templates
650 //===----------------------------------------------------------------------===//
653 template<typename T
> void normalDef() {}
654 template<typename T
> __declspec(dllimport
) void importedNormal() {}
655 template<typename T
> static void staticDef() {}
656 template<typename T
> __declspec(dllimport
) static void importedStatic() {}
659 // Import implicit instantiation of an imported member function template.
660 // M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UImplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
661 // M64-DAG: declare dllimport void @"??$importedNormal@UImplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
662 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(ptr {{[^,]*}} %this)
663 // G64-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl14importedNormalI21ImplicitInst_ImportedEEvv(ptr {{[^,]*}} %this)
664 USEMF(MemFunTmpl
, importedNormal
<ImplicitInst_Imported
>)
666 // MSC-DAG: declare dllimport void @"??$importedStatic@UImplicitInst_Imported@@@MemFunTmpl@@SAXXZ"()
667 // GNU-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl14importedStaticI21ImplicitInst_ImportedEEvv()
668 USE(MemFunTmpl::importedStatic
<ImplicitInst_Imported
>)
671 // Import explicit instantiation declaration of an imported member function
673 // M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitDecl_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
674 // M64-DAG: declare dllimport void @"??$importedNormal@UExplicitDecl_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
675 // G32-DAG: declare dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(ptr {{[^,]*}})
676 // G64-DAG: declare dso_local void @_ZN10MemFunTmpl14importedNormalI21ExplicitDecl_ImportedEEvv(ptr {{[^,]*}})
677 extern template void MemFunTmpl::importedNormal
<ExplicitDecl_Imported
>();
678 USEMF(MemFunTmpl
, importedNormal
<ExplicitDecl_Imported
>)
680 // MSC-DAG: declare dllimport void @"??$importedStatic@UExplicitDecl_Imported@@@MemFunTmpl@@SAXXZ"()
681 // GNU-DAG: declare dso_local void @_ZN10MemFunTmpl14importedStaticI21ExplicitDecl_ImportedEEvv()
682 extern template void MemFunTmpl::importedStatic
<ExplicitDecl_Imported
>();
683 USE(MemFunTmpl::importedStatic
<ExplicitDecl_Imported
>)
686 // Import explicit instantiation definition of an imported member function
688 // M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
689 // M64-DAG: declare dllimport void @"??$importedNormal@UExplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
690 // G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(ptr {{[^,]*}} %this)
691 // G64-DAG: define weak_odr dso_local void @_ZN10MemFunTmpl14importedNormalI21ExplicitInst_ImportedEEvv(ptr {{[^,]*}} %this)
692 template void MemFunTmpl::importedNormal
<ExplicitInst_Imported
>();
693 USEMF(MemFunTmpl
, importedNormal
<ExplicitInst_Imported
>)
695 // MSC-DAG: declare dllimport void @"??$importedStatic@UExplicitInst_Imported@@@MemFunTmpl@@SAXXZ"()
696 // GNU-DAG: define weak_odr dso_local void @_ZN10MemFunTmpl14importedStaticI21ExplicitInst_ImportedEEvv()
697 template void MemFunTmpl::importedStatic
<ExplicitInst_Imported
>();
698 USE(MemFunTmpl::importedStatic
<ExplicitInst_Imported
>)
701 // Import specialization of an imported member function template.
702 // M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitSpec_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
703 // M64-DAG: declare dllimport void @"??$importedNormal@UExplicitSpec_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
704 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI21ExplicitSpec_ImportedEEvv(ptr {{[^,]*}})
705 // G64-DAG: declare dllimport void @_ZN10MemFunTmpl14importedNormalI21ExplicitSpec_ImportedEEvv(ptr {{[^,]*}})
706 template<> __declspec(dllimport
) void MemFunTmpl::importedNormal
<ExplicitSpec_Imported
>();
707 USEMF(MemFunTmpl
, importedNormal
<ExplicitSpec_Imported
>)
709 // M32-DAG-FIXME: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
710 // M64-DAG-FIXME: declare dllimport void @"??$importedNormal@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
712 //template<> __declspec(dllimport) void MemFunTmpl::importedNormal<ExplicitSpec_Def_Imported>() {}
713 //USEMF(MemFunTmpl, importedNormal<ExplicitSpec_Def_Imported>)
716 // M32-DAG: declare dllimport x86_thiscallcc void @"??$importedNormal@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
717 // M64-DAG: declare dllimport void @"??$importedNormal@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
718 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(ptr {{[^,]*}} %this)
719 // G64-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl14importedNormalI31ExplicitSpec_InlineDef_ImportedEEvv(ptr {{[^,]*}} %this)
720 template<> __declspec(dllimport
) inline void MemFunTmpl::importedNormal
<ExplicitSpec_InlineDef_Imported
>() {}
721 USEMF(MemFunTmpl
, importedNormal
<ExplicitSpec_InlineDef_Imported
>)
724 // MSC-DAG: declare dllimport void @"??$importedStatic@UExplicitSpec_Imported@@@MemFunTmpl@@SAXXZ"()
725 // GNU-DAG: declare dllimport void @_ZN10MemFunTmpl14importedStaticI21ExplicitSpec_ImportedEEvv()
726 template<> __declspec(dllimport
) void MemFunTmpl::importedStatic
<ExplicitSpec_Imported
>();
727 USE(MemFunTmpl::importedStatic
<ExplicitSpec_Imported
>)
729 // MSC-DAG-FIXME: declare dllimport void @"??$importedStatic@UExplicitSpec_Def_Imported@@@MemFunTmpl@@SAXXZ"()
731 //template<> __declspec(dllimport) void MemFunTmpl::importedStatic<ExplicitSpec_Def_Imported>() {}
732 //USE(MemFunTmpl::importedStatic<ExplicitSpec_Def_Imported>)
735 // MSC-DAG: declare dllimport void @"??$importedStatic@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@SAXXZ"()
736 // GNU-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl14importedStaticI31ExplicitSpec_InlineDef_ImportedEEvv()
737 template<> __declspec(dllimport
) inline void MemFunTmpl::importedStatic
<ExplicitSpec_InlineDef_Imported
>() {}
738 USE(MemFunTmpl::importedStatic
<ExplicitSpec_InlineDef_Imported
>)
741 // Not importing specialization of an imported member function template without
742 // explicit dllimport.
743 // M32-DAG: define dso_local x86_thiscallcc void @"??$importedNormal@UExplicitSpec_NotImported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}} %this)
744 // M64-DAG: define dso_local void @"??$importedNormal@UExplicitSpec_NotImported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}} %this)
745 // G32-DAG: define dso_local x86_thiscallcc void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(ptr {{[^,]*}} %this)
746 // G64-DAG: define dso_local void @_ZN10MemFunTmpl14importedNormalI24ExplicitSpec_NotImportedEEvv(ptr {{[^,]*}} %this)
747 template<> void MemFunTmpl::importedNormal
<ExplicitSpec_NotImported
>() {}
748 USEMF(MemFunTmpl
, importedNormal
<ExplicitSpec_NotImported
>)
750 // MSC-DAG: define dso_local void @"??$importedStatic@UExplicitSpec_NotImported@@@MemFunTmpl@@SAXXZ"()
751 // GNU-DAG: define dso_local void @_ZN10MemFunTmpl14importedStaticI24ExplicitSpec_NotImportedEEvv()
752 template<> void MemFunTmpl::importedStatic
<ExplicitSpec_NotImported
>() {}
753 USE(MemFunTmpl::importedStatic
<ExplicitSpec_NotImported
>)
756 // Import explicit instantiation declaration of a non-imported member function
758 // M32-DAG: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitDecl_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
759 // M64-DAG: declare dllimport void @"??$normalDef@UExplicitDecl_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
760 // G32-DAG: declare dso_local x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(ptr {{[^,]*}})
761 // G64-DAG: declare dso_local void @_ZN10MemFunTmpl9normalDefI21ExplicitDecl_ImportedEEvv(ptr {{[^,]*}})
762 extern template __declspec(dllimport
) void MemFunTmpl::normalDef
<ExplicitDecl_Imported
>();
763 USEMF(MemFunTmpl
, normalDef
<ExplicitDecl_Imported
>)
765 // MSC-DAG: declare dllimport void @"??$staticDef@UExplicitDecl_Imported@@@MemFunTmpl@@SAXXZ"()
766 // GNU-DAG: declare dso_local void @_ZN10MemFunTmpl9staticDefI21ExplicitDecl_ImportedEEvv()
767 extern template __declspec(dllimport
) void MemFunTmpl::staticDef
<ExplicitDecl_Imported
>();
768 USE(MemFunTmpl::staticDef
<ExplicitDecl_Imported
>)
771 // Import explicit instantiation definition of a non-imported member function
773 // M32-DAG: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitInst_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
774 // M64-DAG: declare dllimport void @"??$normalDef@UExplicitInst_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
775 // G32-DAG: define weak_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(ptr {{[^,]*}} %this)
776 // G64-DAG: define weak_odr dso_local void @_ZN10MemFunTmpl9normalDefI21ExplicitInst_ImportedEEvv(ptr {{[^,]*}} %this)
777 template __declspec(dllimport
) void MemFunTmpl::normalDef
<ExplicitInst_Imported
>();
778 USEMF(MemFunTmpl
, normalDef
<ExplicitInst_Imported
>)
780 // MSC-DAG: declare dllimport void @"??$staticDef@UExplicitInst_Imported@@@MemFunTmpl@@SAXXZ"()
781 // GNU-DAG: define weak_odr dso_local void @_ZN10MemFunTmpl9staticDefI21ExplicitInst_ImportedEEvv()
782 template __declspec(dllimport
) void MemFunTmpl::staticDef
<ExplicitInst_Imported
>();
783 USE(MemFunTmpl::staticDef
<ExplicitInst_Imported
>)
786 // Import specialization of a non-imported member function template.
787 // M32-DAG: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitSpec_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
788 // M64-DAG: declare dllimport void @"??$normalDef@UExplicitSpec_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
789 // G32-DAG: declare dllimport x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI21ExplicitSpec_ImportedEEvv(ptr {{[^,]*}})
790 // G64-DAG: declare dllimport void @_ZN10MemFunTmpl9normalDefI21ExplicitSpec_ImportedEEvv(ptr {{[^,]*}})
791 template<> __declspec(dllimport
) void MemFunTmpl::normalDef
<ExplicitSpec_Imported
>();
792 USEMF(MemFunTmpl
, normalDef
<ExplicitSpec_Imported
>)
794 // M32-DAG-FIXME: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
795 // M64-DAG-FIXME: declare dllimport void @"??$normalDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
797 //template<> __declspec(dllimport) void MemFunTmpl::normalDef<ExplicitSpec_Def_Imported>() {}
798 //USEMF(MemFunTmpl, normalDef<ExplicitSpec_Def_Imported>)
801 // M32-DAG: declare dllimport x86_thiscallcc void @"??$normalDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QAEXXZ"(ptr {{[^,]*}})
802 // M64-DAG: declare dllimport void @"??$normalDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@QEAAXXZ"(ptr {{[^,]*}})
803 // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(ptr {{[^,]*}} %this)
804 // G64-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl9normalDefI31ExplicitSpec_InlineDef_ImportedEEvv(ptr {{[^,]*}} %this)
805 template<> __declspec(dllimport
) inline void MemFunTmpl::normalDef
<ExplicitSpec_InlineDef_Imported
>() {}
806 USEMF(MemFunTmpl
, normalDef
<ExplicitSpec_InlineDef_Imported
>)
809 // MSC-DAG: declare dllimport void @"??$staticDef@UExplicitSpec_Imported@@@MemFunTmpl@@SAXXZ"()
810 // GNU-DAG: declare dllimport void @_ZN10MemFunTmpl9staticDefI21ExplicitSpec_ImportedEEvv()
811 template<> __declspec(dllimport
) void MemFunTmpl::staticDef
<ExplicitSpec_Imported
>();
812 USE(MemFunTmpl::staticDef
<ExplicitSpec_Imported
>)
814 // MSC-DAG-FIXME: declare dllimport void @"??$staticDef@UExplicitSpec_Def_Imported@@@MemFunTmpl@@SAXXZ"()
816 //template<> __declspec(dllimport) void MemFunTmpl::staticDef<ExplicitSpec_Def_Imported>() {}
817 //USE(MemFunTmpl::staticDef<ExplicitSpec_Def_Imported>)
820 // MSC-DAG: declare dllimport void @"??$staticDef@UExplicitSpec_InlineDef_Imported@@@MemFunTmpl@@SAXXZ"()
821 // GNU-DAG: define linkonce_odr dso_local void @_ZN10MemFunTmpl9staticDefI31ExplicitSpec_InlineDef_ImportedEEvv()
822 template<> __declspec(dllimport
) inline void MemFunTmpl::staticDef
<ExplicitSpec_InlineDef_Imported
>() {}
823 USE(MemFunTmpl::staticDef
<ExplicitSpec_InlineDef_Imported
>)
828 template<typename T
> static const int StaticVar
= 1;
829 template<typename T
> __declspec(dllimport
) static const int ImportedStaticVar
= 1;
832 // Import implicit instantiation of an imported member variable template.
833 // MSC-DAG: @"??$ImportedStaticVar@UImplicitInst_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1, align 4
834 // GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI21ImplicitInst_ImportedEE = external dllimport constant i32
835 USEMV(MemVarTmpl
, ImportedStaticVar
<ImplicitInst_Imported
>)
837 // Import explicit instantiation declaration of an imported member variable
839 // MSC-DAG: @"??$ImportedStaticVar@UExplicitDecl_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1
840 // GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI21ExplicitDecl_ImportedEE = external dllimport constant i32
841 extern template const int MemVarTmpl::ImportedStaticVar
<ExplicitDecl_Imported
>;
842 USEMV(MemVarTmpl
, ImportedStaticVar
<ExplicitDecl_Imported
>)
844 // An explicit instantiation definition of an imported member variable template
845 // cannot be imported because the template must be defined which is illegal. The
846 // in-class initializer does not count.
848 // Import specialization of an imported member variable template.
849 // MSC-DAG: @"??$ImportedStaticVar@UExplicitSpec_Imported@@@MemVarTmpl@@2HB" = external dllimport constant i32
850 // GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI21ExplicitSpec_ImportedEE = external dllimport constant i32
851 template<> __declspec(dllimport
) const int MemVarTmpl::ImportedStaticVar
<ExplicitSpec_Imported
>;
852 USEMV(MemVarTmpl
, ImportedStaticVar
<ExplicitSpec_Imported
>)
854 // Not importing specialization of a member variable template without explicit
856 // MSC-DAG: @"??$ImportedStaticVar@UExplicitSpec_NotImported@@@MemVarTmpl@@2HB" = external dso_local constant i32
857 // GNU-DAG: @_ZN10MemVarTmpl17ImportedStaticVarI24ExplicitSpec_NotImportedEE = external constant i32
858 template<> const int MemVarTmpl::ImportedStaticVar
<ExplicitSpec_NotImported
>;
859 USEMV(MemVarTmpl
, ImportedStaticVar
<ExplicitSpec_NotImported
>)
862 // Import explicit instantiation declaration of a non-imported member variable
864 // MSC-DAG: @"??$StaticVar@UExplicitDecl_Imported@@@MemVarTmpl@@2HB" = available_externally dllimport constant i32 1
865 // GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitDecl_ImportedEE = external dllimport constant i32
866 extern template __declspec(dllimport
) const int MemVarTmpl::StaticVar
<ExplicitDecl_Imported
>;
867 USEMV(MemVarTmpl
, StaticVar
<ExplicitDecl_Imported
>)
869 // An explicit instantiation definition of a non-imported member variable template
870 // cannot be imported because the template must be defined which is illegal. The
871 // in-class initializer does not count.
873 // Import specialization of a non-imported member variable template.
874 // MSC-DAG: @"??$StaticVar@UExplicitSpec_Imported@@@MemVarTmpl@@2HB" = external dllimport constant i32
875 // GNU-DAG: @_ZN10MemVarTmpl9StaticVarI21ExplicitSpec_ImportedEE = external dllimport constant i32
876 template<> __declspec(dllimport
) const int MemVarTmpl::StaticVar
<ExplicitSpec_Imported
>;
877 USEMV(MemVarTmpl
, StaticVar
<ExplicitSpec_Imported
>)
880 //===----------------------------------------------------------------------===//
881 // Class template members
882 //===----------------------------------------------------------------------===//
884 template <typename
> struct ClassTmplMem
{
885 void __declspec(dllimport
) importedNormal();
886 static void __declspec(dllimport
) importedStatic();
888 // MSVC imports explicit specialization of imported class template member function; MinGW does not.
889 // M32-DAG: declare dllimport x86_thiscallcc void @"?importedNormal@?$ClassTmplMem@H@@QAEXXZ"
890 // G32-DAG: declare dso_local x86_thiscallcc void @_ZN12ClassTmplMemIiE14importedNormalEv
891 template<> void ClassTmplMem
<int>::importedNormal();
892 USEMF(ClassTmplMem
<int>, importedNormal
);
894 // M32-DAG: declare dllimport void @"?importedStatic@?$ClassTmplMem@H@@SAXXZ"
895 // G32-DAG: declare dso_local void @_ZN12ClassTmplMemIiE14importedStaticEv
896 template<> void ClassTmplMem
<int>::importedStatic();
897 USEMF(ClassTmplMem
<int>, importedStatic
);