| 1 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LINUX |
| 2 |
// RUN: %clang_cc1 -triple x86_64-apple-macos -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LINUX |
| 3 |
// RUN: %clang_cc1 -triple x86_64-windows-pc -fms-compatibility -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WINDOWS |
| 4 |
|
| 5 |
struct S { |
| 6 |
__attribute__((cpu_specific(atom))) |
| 7 |
void Func(){} |
| 8 |
__attribute__((cpu_dispatch(ivybridge,atom))) |
| 9 |
void Func(){} |
| 10 |
}; |
| 11 |
|
| 12 |
void foo() { |
| 13 |
S s; |
| 14 |
s.Func(); |
| 15 |
} |
| 16 |
|
| 17 |
// LINUX: @_ZN1S4FuncEv = weak_odr alias void (ptr), ptr @_ZN1S4FuncEv.ifunc |
| 18 |
// LINUX: @_ZN1S4FuncEv.ifunc = weak_odr ifunc void (ptr), ptr @_ZN1S4FuncEv.resolver |
| 19 |
// LINUX: define weak_odr ptr @_ZN1S4FuncEv.resolver() #[[ATTR_RESOLVER:[0-9]+]] |
| 20 |
// LINUX: ret ptr @_ZN1S4FuncEv.S |
| 21 |
// LINUX: ret ptr @_ZN1S4FuncEv.O |
| 22 |
// LINUX: declare void @_ZN1S4FuncEv.S |
| 23 |
// LINUX: define linkonce_odr void @_ZN1S4FuncEv.O |
| 24 |
|
| 25 |
// WINDOWS: define weak_odr dso_local void @"?Func@S@@QEAAXXZ"(ptr %0) #[[ATTR_RESOLVER:[0-9]+]] comdat |
| 26 |
// WINDOWS: musttail call void @"?Func@S@@QEAAXXZ.S"(ptr %0) |
| 27 |
// WINDOWS: musttail call void @"?Func@S@@QEAAXXZ.O"(ptr %0) |
| 28 |
// WINDOWS: declare dso_local void @"?Func@S@@QEAAXXZ.S" |
| 29 |
// WINDOWS: define linkonce_odr dso_local void @"?Func@S@@QEAAXXZ.O" |
| 30 |
|
| 31 |
// CHECK: attributes #[[ATTR_RESOLVER]] = { disable_sanitizer_instrumentation } |