1 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=LINUX
2 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-pc -fms-compatibility -emit-llvm -o - %s | FileCheck %s --check-prefix=WINDOWS
3
4 struct S {
5 __attribute__((cpu_specific(atom)))
FuncS6 void Func(){}
7 __attribute__((cpu_dispatch(ivybridge,atom)))
FuncS8 void Func(){}
9 };
10
foo()11 void foo() {
12 S s;
13 s.Func();
14 }
15
16 // LINUX: @_ZN1S4FuncEv = weak_odr alias void (%struct.S*), void (%struct.S*)* @_ZN1S4FuncEv.ifunc
17 // LINUX: @_ZN1S4FuncEv.ifunc = weak_odr ifunc void (%struct.S*), void (%struct.S*)* ()* @_ZN1S4FuncEv.resolver
18 // LINUX: define weak_odr void (%struct.S*)* @_ZN1S4FuncEv.resolver
19 // LINUX: ret void (%struct.S*)* @_ZN1S4FuncEv.S
20 // LINUX: ret void (%struct.S*)* @_ZN1S4FuncEv.O
21 // LINUX: declare void @_ZN1S4FuncEv.S
22 // LINUX: define linkonce_odr void @_ZN1S4FuncEv.O
23
24 // WINDOWS: define weak_odr dso_local void @"?Func@S@@QEAAXXZ"(%struct.S* %0) comdat
25 // WINDOWS: musttail call void @"?Func@S@@QEAAXXZ.S"(%struct.S* %0)
26 // WINDOWS: musttail call void @"?Func@S@@QEAAXXZ.O"(%struct.S* %0)
27 // WINDOWS: declare dso_local void @"?Func@S@@QEAAXXZ.S"
28 // WINDOWS: define linkonce_odr dso_local void @"?Func@S@@QEAAXXZ.O"
29