1 // Test that dispatching can choose the right multiversion
2 // for Intel CPUs with the same internal GCC processor id
3 // but slighly different sets of x86 extensions.
5 // { dg-do run { target i?86-*-* x86_64-*-* } }
6 // { dg-require-ifunc "" }
7 // { dg-options "-O2" }
11 int __attribute__ ((target("default")))
17 int __attribute__ ((target("arch=nehalem")))
23 int __attribute__ ((target("arch=westmere")))
29 int __attribute__ ((target("arch=sandybridge")))
35 int __attribute__ ((target("arch=ivybridge")))
41 int __attribute__ ((target("arch=haswell")))
47 int __attribute__ ((target("arch=broadwell"))) foo () {
51 int __attribute__ ((target("arch=skylake"))) foo () {
55 int __attribute__ ((target("arch=skylake-avx512"))) foo () {
59 int __attribute__ ((target("arch=cannonlake"))) foo () {
63 int __attribute__ ((target("arch=icelake-client"))) foo () {
67 int __attribute__ ((target("arch=icelake-server"))) foo () {
75 if (__builtin_cpu_is ("nehalem"))
77 else if (__builtin_cpu_is ("westmere"))
79 else if (__builtin_cpu_is ("sandybridge"))
81 else if (__builtin_cpu_is ("ivybridge"))
83 else if (__builtin_cpu_is ("haswell"))
85 else if (__builtin_cpu_is ("broadwell"))
87 else if (__builtin_cpu_is ("skylake"))
89 else if (__builtin_cpu_is ("skylake-avx512"))
91 else if (__builtin_cpu_is ("cannonlake"))
93 else if (__builtin_cpu_is ("icelake-client"))
95 else if (__builtin_cpu_is ("icelake-server"))