1 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-linux-gnu -emit-llvm -o - -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb %s | FileCheck %s --check-prefixes=CHECK,LIN
2 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-pc -emit-llvm -o - -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb %s | FileCheck %s --check-prefixes=CHECK,WIN
3 
4 // LIN: @[[S1_NAME:.+]].ifunc = weak_odr ifunc void (%struct.S1*), void (%struct.S1*)* ()* @[[S1_NAME]].resolver
5 // LIN: @[[S2_NAME:.+]].ifunc = weak_odr ifunc void (%struct.S2*), void (%struct.S2*)* ()* @[[S2_NAME]].resolver
6 // WIN: $"[[S1_NAME:.+]]" = comdat any
7 // WIN: $"[[S2_NAME:.+]]" = comdat any
8 
9 struct S1 {
10   void foo();
11   void mv();
12 };
13 
foo()14 void S1::foo(){}
15 
16 __attribute__((cpu_dispatch(ivybridge, generic)))
mv()17 void S1::mv() {}
18 // LIN: define weak_odr void (%struct.S1*)* @[[S1_NAME]].resolver
19 // WIN: define weak_odr dso_local void @"[[S1_NAME]]"(%struct.S1*
20 __attribute__((cpu_specific(generic)))
mv()21 void S1::mv() {}
22 // CHECK: define dso_local {{.*}}void @{{\"?}}[[S1_NAME]].S{{\"?}}
23 // CHECK: define dso_local {{.*}}void @{{\"?}}[[S1_NAME]].A{{\"?}}
24 __attribute__((cpu_specific(ivybridge)))
mv()25 void S1::mv() {}
26 
27 struct S2 {
28   void foo();
29   void mv();
30 };
31 
foo()32 void S2::foo(){}
33 
34 __attribute__((cpu_specific(generic)))
mv()35 void S2::mv() {}
36 // CHECK: define dso_local {{.*}}void @{{\"?}}[[S2_NAME]].A{{\"?}}
37 __attribute__((cpu_dispatch(ivybridge, generic)))
mv()38 void S2::mv() {}
39 // LIN: define weak_odr void (%struct.S2*)* @[[S2_NAME]].resolver
40 // WIN: define weak_odr dso_local void @"[[S2_NAME]]"(%struct.S2*
41 __attribute__((cpu_specific(ivybridge)))
mv()42 void S2::mv() {}
43 // CHECK: define dso_local {{.*}}void @{{\"?}}[[S2_NAME]].S{{\"?}}
44