1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefixes=ITANIUM,LINUX
2 // RUN: %clang_cc1 -triple x86_64-apple-macos -emit-llvm %s -o - | FileCheck %s --check-prefixes=ITANIUM,DARWIN
3 // RUN: %clang_cc1 -triple x86_64-windows-pc -emit-llvm %s -o - | FileCheck %s --check-prefix=WINDOWS
5 int __attribute__((target("sse4.2"))) foo(void) { return 0; }
6 int __attribute__((target("arch=sandybridge"))) foo(void);
7 int __attribute__((target("arch=ivybridge"))) foo(void) {return 1;}
8 int __attribute__((target("arch=goldmont"))) foo(void) {return 3;}
9 int __attribute__((target("arch=goldmont-plus"))) foo(void) {return 4;}
10 int __attribute__((target("arch=tremont"))) foo(void) {return 5;}
11 int __attribute__((target("arch=icelake-client"))) foo(void) {return 6;}
12 int __attribute__((target("arch=icelake-server"))) foo(void) {return 7;}
13 int __attribute__((target("arch=cooperlake"))) foo(void) {return 8;}
14 int __attribute__((target("arch=tigerlake"))) foo(void) {return 9;}
15 int __attribute__((target("arch=sapphirerapids"))) foo(void) {return 10;}
16 int __attribute__((target("arch=alderlake"))) foo(void) {return 11;}
17 int __attribute__((target("arch=rocketlake"))) foo(void) {return 12;}
18 int __attribute__((target("arch=core2"))) foo(void) {return 13;}
19 int __attribute__((target("arch=raptorlake"))) foo(void) {return 14;}
20 int __attribute__((target("arch=meteorlake"))) foo(void) {return 15;}
21 int __attribute__((target("arch=sierraforest"))) foo(void) {return 16;}
22 int __attribute__((target("arch=grandridge"))) foo(void) {return 17;}
23 int __attribute__((target("arch=graniterapids"))) foo(void) {return 18;}
24 int __attribute__((target("arch=emeraldrapids"))) foo(void) {return 19;}
25 int __attribute__((target("arch=graniterapids-d"))) foo(void) {return 20;}
26 int __attribute__((target("arch=arrowlake"))) foo(void) {return 21;}
27 int __attribute__((target("arch=arrowlake-s"))) foo(void) {return 22;}
28 int __attribute__((target("arch=lunarlake"))) foo(void) {return 23;}
29 int __attribute__((target("arch=gracemont"))) foo(void) {return 24;}
30 int __attribute__((target("arch=pantherlake"))) foo(void) {return 25;}
31 int __attribute__((target("arch=clearwaterforest"))) foo(void) {return 26;}
32 int __attribute__((target("arch=diamondrapids"))) foo(void) {return 27;}
33 int __attribute__((target("default"))) foo(void) { return 2; }
39 static int __attribute__((target("arch=meteorlake"))) foo_internal(void) {return 15;}
40 static int __attribute__((target("default"))) foo_internal(void) { return 2; }
43 return foo_internal();
46 inline int __attribute__((target("sse4.2"))) foo_inline(void) { return 0; }
47 inline int __attribute__((target("arch=sandybridge"))) foo_inline(void);
48 inline int __attribute__((target("arch=ivybridge"))) foo_inline(void) {return 1;}
49 inline int __attribute__((target("default"))) foo_inline(void) { return 2; }
55 inline __attribute__((target("default"))) void foo_decls(void);
56 inline __attribute__((target("sse4.2"))) void foo_decls(void);
60 inline __attribute__((target("default"))) void foo_decls(void) {}
61 inline __attribute__((target("sse4.2"))) void foo_decls(void) {}
63 inline __attribute__((target("default"))) void foo_multi(int i
, double d
) {}
64 inline __attribute__((target("avx,sse4.2"))) void foo_multi(int i
, double d
) {}
65 inline __attribute__((target("sse4.2,fma4"))) void foo_multi(int i
, double d
) {}
66 inline __attribute__((target("arch=ivybridge,fma4,sse4.2"))) void foo_multi(int i
, double d
) {}
71 int fwd_decl_default(void);
72 int __attribute__((target("default"))) fwd_decl_default(void) { return 2; }
74 int fwd_decl_avx(void);
75 int __attribute__((target("avx"))) fwd_decl_avx(void) { return 2; }
76 int __attribute__((target("default"))) fwd_decl_avx(void) { return 2; }
83 int __attribute__((target("avx"))) changed_to_mv(void) { return 0;}
84 int __attribute__((target("fma4"))) changed_to_mv(void) { return 1;}
86 __attribute__((target("default"), used
)) inline void foo_used(int i
, double d
) {}
87 __attribute__((target("avx,sse4.2"))) inline void foo_used(int i
, double d
) {}
89 __attribute__((target("default"))) inline void foo_used2(int i
, double d
) {}
90 __attribute__((target("avx,sse4.2"), used
)) inline void foo_used2(int i
, double d
) {}
93 static void must_be_emitted(void) {}
94 inline __attribute__((target("default"))) void pr50025(void) { must_be_emitted(); }
95 void calls_pr50025(void) { pr50025(); }
97 // Also need to make sure we get other multiversion functions.
98 inline __attribute__((target("default"))) void pr50025b(void) { must_be_emitted(); }
99 inline __attribute__((target("default"))) void pr50025c(void) { pr50025b(); }
100 void calls_pr50025c(void) { pr50025c(); }
102 // LINUX: $foo.resolver = comdat any
103 // LINUX: $foo_inline.resolver = comdat any
104 // LINUX: $foo_decls.resolver = comdat any
105 // LINUX: $foo_multi.resolver = comdat any
106 // LINUX: $fwd_decl_default.resolver = comdat any
107 // LINUX: $fwd_decl_avx.resolver = comdat any
108 // LINUX: $pr50025.resolver = comdat any
109 // LINUX: $pr50025c.resolver = comdat any
110 // LINUX: $pr50025b.resolver = comdat any
112 // DARWIN-NOT: comdat
114 // WINDOWS: $foo.resolver = comdat any
115 // WINDOWS: $foo_inline.resolver = comdat any
116 // WINDOWS: $foo_decls.resolver = comdat any
117 // WINDOWS: $foo_multi.resolver = comdat any
118 // WINDOWS: $fwd_decl_default.resolver = comdat any
119 // WINDOWS: $fwd_decl_avx.resolver = comdat any
120 // WINDOWS: $foo_used = comdat any
121 // WINDOWS: $foo_used2.avx_sse4.2 = comdat any
122 // WINDOWS: $pr50025.resolver = comdat any
123 // WINDOWS: $pr50025c.resolver = comdat any
124 // WINDOWS: $foo_inline.sse4.2 = comdat any
125 // WINDOWS: $foo_inline.arch_ivybridge = comdat any
126 // WINDOWS: $foo_inline = comdat any
127 // WINDOWS: $foo_decls = comdat any
128 // WINDOWS: $foo_decls.sse4.2 = comdat any
129 // WINDOWS: $foo_multi = comdat any
130 // WINDOWS: $foo_multi.avx_sse4.2 = comdat any
131 // WINDOWS: $foo_multi.fma4_sse4.2 = comdat any
132 // WINDOWS: $foo_multi.arch_ivybridge_fma4_sse4.2 = comdat any
133 // WINDOWS: $pr50025 = comdat any
134 // WINDOWS: $pr50025c = comdat any
135 // WINDOWS: $pr50025b.resolver = comdat any
136 // WINDOWS: $pr50025b = comdat any
139 // LINUX: @llvm.compiler.used = appending global [2 x ptr] [ptr @foo_used, ptr @foo_used2.avx_sse4.2], section "llvm.metadata"
140 // DARWIN: @llvm.used = appending global [2 x ptr] [ptr @foo_used, ptr @foo_used2.avx_sse4.2], section "llvm.metadata"
141 // WINDOWS: @llvm.used = appending global [2 x ptr] [ptr @foo_used, ptr @foo_used2.avx_sse4.2], section "llvm.metadata"
144 // ITANIUM: @foo.ifunc = weak_odr ifunc i32 (), ptr @foo.resolver
145 // ITANIUM: @foo_internal.ifunc = internal ifunc i32 (), ptr @foo_internal.resolver
146 // ITANIUM: @foo_inline.ifunc = weak_odr ifunc i32 (), ptr @foo_inline.resolver
147 // ITANIUM: @foo_decls.ifunc = weak_odr ifunc void (), ptr @foo_decls.resolver
148 // ITANIUM: @foo_multi.ifunc = weak_odr ifunc void (i32, double), ptr @foo_multi.resolver
149 // ITANIUM: @fwd_decl_default.ifunc = weak_odr ifunc i32 (), ptr @fwd_decl_default.resolver
150 // ITANIUM: @fwd_decl_avx.ifunc = weak_odr ifunc i32 (), ptr @fwd_decl_avx.resolver
152 // ITANIUM: define{{.*}} i32 @foo.sse4.2()
153 // ITANIUM: ret i32 0
154 // ITANIUM: define{{.*}} i32 @foo.arch_ivybridge()
155 // ITANIUM: ret i32 1
156 // ITANIUM: define{{.*}} i32 @foo.arch_goldmont()
157 // ITANIUM: ret i32 3
158 // ITANIUM: define{{.*}} i32 @foo.arch_goldmont-plus()
159 // ITANIUM: ret i32 4
160 // ITANIUM: define{{.*}} i32 @foo.arch_tremont()
161 // ITANIUM: ret i32 5
162 // ITANIUM: define{{.*}} i32 @foo.arch_icelake-client()
163 // ITANIUM: ret i32 6
164 // ITANIUM: define{{.*}} i32 @foo.arch_icelake-server()
165 // ITANIUM: ret i32 7
166 // ITANIUM: define{{.*}} i32 @foo.arch_cooperlake()
167 // ITANIUM: ret i32 8
168 // ITANIUM: define{{.*}} i32 @foo.arch_tigerlake()
169 // ITANIUM: ret i32 9
170 // ITANIUM: define{{.*}} i32 @foo.arch_sapphirerapids()
171 // ITANIUM: ret i32 10
172 // ITANIUM: define{{.*}} i32 @foo.arch_alderlake()
173 // ITANIUM: ret i32 11
174 // ITANIUM: define{{.*}} i32 @foo.arch_rocketlake()
175 // ITANIUM: ret i32 12
176 // ITANIUM: define{{.*}} i32 @foo.arch_core2()
177 // ITANIUM: ret i32 13
178 // ITANIUM: define{{.*}} i32 @foo.arch_raptorlake()
179 // ITANIUM: ret i32 14
180 // ITANIUM: define{{.*}} i32 @foo.arch_meteorlake()
181 // ITANIUM: ret i32 15
182 // ITANIUM: define{{.*}} i32 @foo.arch_sierraforest()
183 // ITANIUM: ret i32 16
184 // ITANIUM: define{{.*}} i32 @foo.arch_grandridge()
185 // ITANIUM: ret i32 17
186 // ITANIUM: define{{.*}} i32 @foo.arch_graniterapids()
187 // ITANIUM: ret i32 18
188 // ITANIUM: define{{.*}} i32 @foo.arch_emeraldrapids()
189 // ITANIUM: ret i32 19
190 // ITANIUM: define{{.*}} i32 @foo.arch_graniterapids-d()
191 // ITANIUM: ret i32 20
192 // ITANIUM: define{{.*}} i32 @foo.arch_arrowlake()
193 // ITANIUM: ret i32 21
194 // ITANIUM: define{{.*}} i32 @foo.arch_arrowlake-s()
195 // ITANIUM: ret i32 22
196 // ITANIUM: define{{.*}} i32 @foo.arch_lunarlake()
197 // ITANIUM: ret i32 23
198 // ITANIUM: define{{.*}} i32 @foo.arch_gracemont()
199 // ITANIUM: ret i32 24
200 // ITANIUM: define{{.*}} i32 @foo.arch_pantherlake()
201 // ITANIUM: ret i32 25
202 // ITANIUM: define{{.*}} i32 @foo.arch_clearwaterforest()
203 // ITANIUM: ret i32 26
204 // ITANIUM: define{{.*}} i32 @foo()
205 // ITANIUM: ret i32 2
206 // ITANIUM: define{{.*}} i32 @bar()
207 // ITANIUM: call i32 @foo.ifunc()
209 // WINDOWS: define dso_local i32 @foo.sse4.2()
210 // WINDOWS: ret i32 0
211 // WINDOWS: define dso_local i32 @foo.arch_ivybridge()
212 // WINDOWS: ret i32 1
213 // WINDOWS: define dso_local i32 @foo.arch_goldmont()
214 // WINDOWS: ret i32 3
215 // WINDOWS: define dso_local i32 @foo.arch_goldmont-plus()
216 // WINDOWS: ret i32 4
217 // WINDOWS: define dso_local i32 @foo.arch_tremont()
218 // WINDOWS: ret i32 5
219 // WINDOWS: define dso_local i32 @foo.arch_icelake-client()
220 // WINDOWS: ret i32 6
221 // WINDOWS: define dso_local i32 @foo.arch_icelake-server()
222 // WINDOWS: ret i32 7
223 // WINDOWS: define dso_local i32 @foo.arch_cooperlake()
224 // WINDOWS: ret i32 8
225 // WINDOWS: define dso_local i32 @foo.arch_tigerlake()
226 // WINDOWS: ret i32 9
227 // WINDOWS: define dso_local i32 @foo.arch_sapphirerapids()
228 // WINDOWS: ret i32 10
229 // WINDOWS: define dso_local i32 @foo.arch_alderlake()
230 // WINDOWS: ret i32 11
231 // WINDOWS: define dso_local i32 @foo.arch_rocketlake()
232 // WINDOWS: ret i32 12
233 // WINDOWS: define dso_local i32 @foo.arch_core2()
234 // WINDOWS: ret i32 13
235 // WINDOWS: define dso_local i32 @foo.arch_raptorlake()
236 // WINDOWS: ret i32 14
237 // WINDOWS: define dso_local i32 @foo.arch_meteorlake()
238 // WINDOWS: ret i32 15
239 // WINDOWS: define{{.*}} i32 @foo.arch_sierraforest()
240 // WINDOWS: ret i32 16
241 // WINDOWS: define{{.*}} i32 @foo.arch_grandridge()
242 // WINDOWS: ret i32 17
243 // WINDOWS: define{{.*}} i32 @foo.arch_graniterapids()
244 // WINDOWS: ret i32 18
245 // WINDOWS: define dso_local i32 @foo.arch_emeraldrapids()
246 // WINDOWS: ret i32 19
247 // WINDOWS: define dso_local i32 @foo.arch_graniterapids-d()
248 // WINDOWS: ret i32 20
249 // WINDOWS: define dso_local i32 @foo.arch_arrowlake()
250 // WINDOWS: ret i32 21
251 // WINDOWS: define dso_local i32 @foo.arch_arrowlake-s()
252 // WINDOWS: ret i32 22
253 // WINDOWS: define dso_local i32 @foo.arch_lunarlake()
254 // WINDOWS: ret i32 23
255 // WINDOWS: define dso_local i32 @foo.arch_gracemont()
256 // WINDOWS: ret i32 24
257 // WINDOWS: define dso_local i32 @foo.arch_pantherlake()
258 // WINDOWS: ret i32 25
259 // WINDOWS: define dso_local i32 @foo.arch_clearwaterforest()
260 // WINDOWS: ret i32 26
261 // WINDOWS: define dso_local i32 @foo()
262 // WINDOWS: ret i32 2
263 // WINDOWS: define dso_local i32 @bar()
264 // WINDOWS: call i32 @foo.resolver()
266 // ITANIUM: define weak_odr ptr @foo.resolver()
267 // LINUX-SAME: comdat
268 // ITANIUM: call void @__cpu_indicator_init()
269 // ITANIUM: ret ptr @foo.arch_sandybridge
270 // ITANIUM: ret ptr @foo.arch_ivybridge
271 // ITANIUM: ret ptr @foo.sse4.2
272 // ITANIUM: ret ptr @foo
274 // WINDOWS: define weak_odr dso_local i32 @foo.resolver() comdat
275 // WINDOWS: call void @__cpu_indicator_init()
276 // WINDOWS: call i32 @foo.arch_sandybridge
277 // WINDOWS: call i32 @foo.arch_ivybridge
278 // WINDOWS: call i32 @foo.sse4.2
279 // WINDOWS: call i32 @foo
281 /// Internal linkage resolvers do not use comdat.
282 // ITANIUM: define internal ptr @foo_internal.resolver() {
284 // WINDOWS: define internal i32 @foo_internal.resolver() {
286 // ITANIUM: define{{.*}} i32 @bar2()
287 // ITANIUM: call i32 @foo_inline.ifunc()
289 // WINDOWS: define dso_local i32 @bar2()
290 // WINDOWS: call i32 @foo_inline.resolver()
292 // ITANIUM: define weak_odr ptr @foo_inline.resolver()
293 // LINUX-SAME: comdat
294 // ITANIUM: call void @__cpu_indicator_init()
295 // ITANIUM: ret ptr @foo_inline.arch_sandybridge
296 // ITANIUM: ret ptr @foo_inline.arch_ivybridge
297 // ITANIUM: ret ptr @foo_inline.sse4.2
298 // ITANIUM: ret ptr @foo_inline
300 // WINDOWS: define weak_odr dso_local i32 @foo_inline.resolver() comdat
301 // WINDOWS: call void @__cpu_indicator_init()
302 // WINDOWS: call i32 @foo_inline.arch_sandybridge
303 // WINDOWS: call i32 @foo_inline.arch_ivybridge
304 // WINDOWS: call i32 @foo_inline.sse4.2
305 // WINDOWS: call i32 @foo_inline
307 // ITANIUM: define{{.*}} void @bar3()
308 // ITANIUM: call void @foo_decls.ifunc()
310 // WINDOWS: define dso_local void @bar3()
311 // WINDOWS: call void @foo_decls.resolver()
313 // ITANIUM: define weak_odr ptr @foo_decls.resolver()
314 // LINUX-SAME: comdat
315 // ITANIUM: ret ptr @foo_decls.sse4.2
316 // ITANIUM: ret ptr @foo_decls
318 // WINDOWS: define weak_odr dso_local void @foo_decls.resolver() comdat
319 // WINDOWS: call void @foo_decls.sse4.2
320 // WINDOWS: call void @foo_decls
322 // ITANIUM: define{{.*}} void @bar4()
323 // ITANIUM: call void @foo_multi.ifunc(i32 noundef 1, double noundef 5.{{[0+e]*}})
325 // WINDOWS: define dso_local void @bar4()
326 // WINDOWS: call void @foo_multi.resolver(i32 noundef 1, double noundef 5.{{[0+e]*}})
328 // ITANIUM: define weak_odr ptr @foo_multi.resolver()
329 // LINUX-SAME: comdat
330 // ITANIUM: and i32 %{{.*}}, 4352
331 // ITANIUM: icmp eq i32 %{{.*}}, 4352
332 // ITANIUM: ret ptr @foo_multi.fma4_sse4.2
333 // ITANIUM: icmp eq i32 %{{.*}}, 12
334 // ITANIUM: and i32 %{{.*}}, 4352
335 // ITANIUM: icmp eq i32 %{{.*}}, 4352
336 // ITANIUM: ret ptr @foo_multi.arch_ivybridge_fma4_sse4.2
337 // ITANIUM: and i32 %{{.*}}, 768
338 // ITANIUM: icmp eq i32 %{{.*}}, 768
339 // ITANIUM: ret ptr @foo_multi.avx_sse4.2
340 // ITANIUM: ret ptr @foo_multi
342 // WINDOWS: define weak_odr dso_local void @foo_multi.resolver(i32 %0, double %1) comdat
343 // WINDOWS: and i32 %{{.*}}, 4352
344 // WINDOWS: icmp eq i32 %{{.*}}, 4352
345 // WINDOWS: call void @foo_multi.fma4_sse4.2(i32 %0, double %1)
346 // WINDOWS-NEXT: ret void
347 // WINDOWS: icmp eq i32 %{{.*}}, 12
348 // WINDOWS: and i32 %{{.*}}, 4352
349 // WINDOWS: icmp eq i32 %{{.*}}, 4352
350 // WINDOWS: call void @foo_multi.arch_ivybridge_fma4_sse4.2(i32 %0, double %1)
351 // WINDOWS-NEXT: ret void
352 // WINDOWS: and i32 %{{.*}}, 768
353 // WINDOWS: icmp eq i32 %{{.*}}, 768
354 // WINDOWS: call void @foo_multi.avx_sse4.2(i32 %0, double %1)
355 // WINDOWS-NEXT: ret void
356 // WINDOWS: call void @foo_multi(i32 %0, double %1)
357 // WINDOWS-NEXT: ret void
359 // ITANIUM: define{{.*}} i32 @fwd_decl_default()
360 // ITANIUM: ret i32 2
361 // ITANIUM: define{{.*}} i32 @fwd_decl_avx.avx()
362 // ITANIUM: ret i32 2
363 // ITANIUM: define{{.*}} i32 @fwd_decl_avx()
364 // ITANIUM: ret i32 2
366 // WINDOWS: define dso_local i32 @fwd_decl_default()
367 // WINDOWS: ret i32 2
368 // WINDOWS: define dso_local i32 @fwd_decl_avx.avx()
369 // WINDOWS: ret i32 2
370 // WINDOWS: define dso_local i32 @fwd_decl_avx()
371 // WINDOWS: ret i32 2
373 // ITANIUM: define{{.*}} void @bar5()
374 // ITANIUM: call i32 @fwd_decl_default.ifunc()
375 // ITANIUM: call i32 @fwd_decl_avx.ifunc()
377 // WINDOWS: define dso_local void @bar5()
378 // WINDOWS: call i32 @fwd_decl_default.resolver()
379 // WINDOWS: call i32 @fwd_decl_avx.resolver()
381 // ITANIUM: define weak_odr ptr @fwd_decl_default.resolver()
382 // LINUX-SAME: comdat
383 // ITANIUM: call void @__cpu_indicator_init()
384 // ITANIUM: ret ptr @fwd_decl_default
385 // ITANIUM: define weak_odr ptr @fwd_decl_avx.resolver()
386 // LINUX-SAME: comdat
387 // ITANIUM: call void @__cpu_indicator_init()
388 // ITANIUM: ret ptr @fwd_decl_avx.avx
389 // ITANIUM: ret ptr @fwd_decl_avx
391 // WINDOWS: define weak_odr dso_local i32 @fwd_decl_default.resolver() comdat
392 // WINDOWS: call void @__cpu_indicator_init()
393 // WINDOWS: call i32 @fwd_decl_default
394 // WINDOWS: define weak_odr dso_local i32 @fwd_decl_avx.resolver() comdat
395 // WINDOWS: call void @__cpu_indicator_init()
396 // WINDOWS: call i32 @fwd_decl_avx.avx
397 // WINDOWS: call i32 @fwd_decl_avx
399 // ITANIUM: define{{.*}} i32 @changed_to_mv.avx()
400 // ITANIUM: define{{.*}} i32 @changed_to_mv.fma4()
402 // WINDOWS: define dso_local i32 @changed_to_mv.avx()
403 // WINDOWS: define dso_local i32 @changed_to_mv.fma4()
405 // ITANIUM: define linkonce void @foo_used(i32 noundef %{{.*}}, double noundef %{{.*}})
406 // ITANIUM-NOT: @foo_used.avx_sse4.2(
407 // ITANIUM-NOT: @foo_used2(
408 // ITANIUM: define linkonce void @foo_used2.avx_sse4.2(i32 noundef %{{.*}}, double noundef %{{.*}})
410 // WINDOWS: define linkonce_odr dso_local void @foo_used(i32 noundef %{{.*}}, double noundef %{{.*}})
411 // WINDOWS-NOT: @foo_used.avx_sse4.2(
412 // WINDOWS-NOT: @foo_used2(
413 // WINDOWS: define linkonce_odr dso_local void @foo_used2.avx_sse4.2(i32 noundef %{{.*}}, double noundef %{{.*}})
415 // ITANIUM: declare i32 @foo.arch_sandybridge()
416 // WINDOWS: declare dso_local i32 @foo.arch_sandybridge()
418 // ITANIUM: define linkonce i32 @foo_inline.sse4.2()
419 // ITANIUM: ret i32 0
421 // WINDOWS: define linkonce_odr dso_local i32 @foo_inline.sse4.2()
422 // WINDOWS: ret i32 0
424 // ITANIUM: declare i32 @foo_inline.arch_sandybridge()
426 // WINDOWS: declare dso_local i32 @foo_inline.arch_sandybridge()
428 // ITANIUM: define linkonce i32 @foo_inline.arch_ivybridge()
429 // ITANIUM: ret i32 1
430 // ITANIUM: define linkonce i32 @foo_inline()
431 // ITANIUM: ret i32 2
433 // WINDOWS: define linkonce_odr dso_local i32 @foo_inline.arch_ivybridge()
434 // WINDOWS: ret i32 1
435 // WINDOWS: define linkonce_odr dso_local i32 @foo_inline()
436 // WINDOWS: ret i32 2
438 // ITANIUM: define linkonce void @foo_decls()
439 // ITANIUM: define linkonce void @foo_decls.sse4.2()
441 // WINDOWS: define linkonce_odr dso_local void @foo_decls()
442 // WINDOWS: define linkonce_odr dso_local void @foo_decls.sse4.2()
444 // ITANIUM: define linkonce void @foo_multi(i32 noundef %{{[^,]+}}, double noundef %{{[^\)]+}})
445 // ITANIUM: define linkonce void @foo_multi.avx_sse4.2(i32 noundef %{{[^,]+}}, double noundef %{{[^\)]+}})
446 // ITANIUM: define linkonce void @foo_multi.fma4_sse4.2(i32 noundef %{{[^,]+}}, double noundef %{{[^\)]+}})
447 // ITANIUM: define linkonce void @foo_multi.arch_ivybridge_fma4_sse4.2(i32 noundef %{{[^,]+}}, double noundef %{{[^\)]+}})
449 // WINDOWS: define linkonce_odr dso_local void @foo_multi(i32 noundef %{{[^,]+}}, double noundef %{{[^\)]+}})
450 // WINDOWS: define linkonce_odr dso_local void @foo_multi.avx_sse4.2(i32 noundef %{{[^,]+}}, double noundef %{{[^\)]+}})
451 // WINDOWS: define linkonce_odr dso_local void @foo_multi.fma4_sse4.2(i32 noundef %{{[^,]+}}, double noundef %{{[^\)]+}})
452 // WINDOWS: define linkonce_odr dso_local void @foo_multi.arch_ivybridge_fma4_sse4.2(i32 noundef %{{[^,]+}}, double noundef %{{[^\)]+}})
454 // Ensure that we emit the 'static' function here.
455 // ITANIUM: define linkonce void @pr50025()
456 // ITANIUM: call void @must_be_emitted
457 // ITANIUM: define internal void @must_be_emitted()
458 // WINDOWS: define linkonce_odr dso_local void @pr50025() #{{[0-9]*}} comdat
459 // WINDOWS: call void @must_be_emitted
460 // WINDOWS: define internal void @must_be_emitted()
462 // ITANIUM: define linkonce void @pr50025c()
463 // ITANIUM: call void @pr50025b.ifunc()
464 // WINDOWS: define linkonce_odr dso_local void @pr50025c() #{{[0-9]*}} comdat
465 // WINDOWS: call void @pr50025b.resolver()
467 // ITANIUM: define weak_odr ptr @pr50025b.resolver()
468 // LINUX-SAME: comdat
469 // ITANIUM: ret ptr @pr50025b
470 // ITANIUM: define linkonce void @pr50025b()
471 // ITANIUM: call void @must_be_emitted()
472 // WINDOWS: define weak_odr dso_local void @pr50025b.resolver() comdat
473 // WINDOWS: musttail call void @pr50025b()
474 // WINDOWS: define linkonce_odr dso_local void @pr50025b() #{{[0-9]*}} comdat
475 // WINDOWS: call void @must_be_emitted()