Debian Codegraph @

gcc/testsuite/g++.target/i386/mv25.C

raw
1 // Test case to check if Multiversioning works for PCLMUL
2
3 // { dg-do run }
4 // { dg-require-ifunc "" }
5 // { dg-options "-O2" }
6
7 #include <assert.h>
8
9 // Check if PCLMUL feature selection works
10 int foo () __attribute__((target("default")));
11 int foo () __attribute__((target("pclmul")));
12
13 int main ()
14 {
15 int val = foo ();
16
17 if (__builtin_cpu_supports ("pclmul"))
18 assert (val == 1);
19 else
20 assert (val == 0);
21
22 return 0;
23 }
24
25 int __attribute__ ((target("default")))
26 foo ()
27 {
28 return 0;
29 }
30
31 int __attribute__ ((target("pclmul")))
32 foo ()
33 {
34 return 1;
35 }