FreddyYe added a comment. It came to me a better style:
ATTR(cpu_specific(generic)) void CPU1(void){} ATTR(cpu_specific(pentium_pro)) void CPU2(void){} ATTR(cpu_specific(pentium_mmx)) void CPU3(void){} ATTR(cpu_specific(pentium_ii)) void CPU4(void){} ATTR(cpu_specific(pentium_iii)) void CPU5(void){} ATTR(cpu_specific(pentium_iii_no_xmm_regs)) void CPU6(void){} ... My purpose here is only to check if the cpu name string is valid for cpu_specific. So this also looks good, though it doesn't do the multiversion. I'll change into this style if no objections. ================ Comment at: clang/test/CodeGen/attr-cpuspecific-cpus.c:1-2 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-windows-pc -fms-compatibility -emit-llvm -o - %s + ---------------- pengfei wrote: > Is it only to check no compile warning/error? Should we add a `-verify`? Yes, that's my purpose. Will do. ================ Comment at: clang/test/CodeGen/attr-cpuspecific-cpus.c:8 +#define ATTR(X) __attribute__((X)) +#endif // _MSC_VER + ---------------- pengfei wrote: > _MSC_VER or _WIN64? Good catch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152989/new/ https://reviews.llvm.org/D152989 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits