Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.target/i386/mv24.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 // Test case to check if Multiversioning works for AES | |
2 | |
3 // { dg-do run } | |
4 // { dg-require-ifunc "" } | |
5 // { dg-options "-O2" } | |
6 | |
7 #include <assert.h> | |
8 | |
9 // Check if AES feature selection works | |
10 int foo () __attribute__((target("default"))); | |
11 int foo () __attribute__((target("aes"))); | |
12 | |
13 int main () | |
14 { | |
15 int val = foo (); | |
16 | |
17 if (__builtin_cpu_supports ("aes")) | |
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("aes"))) | |
32 foo () | |
33 { | |
34 return 1; | |
35 } |