[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / ext / mv25.C
blobfd40eca59a5b7ea4a4f7b14ed662baffc0fe386b
1 // Test case to check if Multiversioning works for PCLMUL
3 // { dg-do run { target i?86-*-* x86_64-*-* } }
4 // { dg-require-ifunc "" }
5 // { dg-options "-O2" }
7 #include <assert.h>
9 // Check if PCLMUL feature selection works
10 int foo () __attribute__((target("default")));
11 int foo () __attribute__((target("pclmul")));
13 int main ()
15   int val = foo ();
17   if (__builtin_cpu_supports ("pclmul"))
18     assert (val == 1);
19   else
20     assert (val == 0);
22   return 0;
25 int __attribute__ ((target("default")))
26 foo ()
28   return 0;
31 int __attribute__ ((target("pclmul")))
32 foo ()
34   return 1;