* doc/extend.texi (Loop-Specific Pragmas): Document pragma GCC unroll.
[official-gcc.git] / gcc / testsuite / g++.dg / ext / mv24.C
blob58292a833928b5e3364e33a4257dffb82e8bf8c9
1 // Test case to check if Multiversioning works for AES
3 // { dg-do run { target i?86-*-* x86_64-*-* } }
4 // { dg-require-ifunc "" }
5 // { dg-options "-O2" }
7 #include <assert.h>
9 // Check if AES feature selection works
10 int foo () __attribute__((target("default")));
11 int foo () __attribute__((target("aes")));
13 int main ()
15   int val = foo ();
17   if (__builtin_cpu_supports ("aes"))
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("aes")))
32 foo ()
34   return 1;