gcc/testsuite/gcc.target/i386/pr77756.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | #include "cpuid.h" |
| 4 | |
| 5 | int |
| 6 | main () |
| 7 | { |
| 8 | __builtin_cpu_init (); |
| 9 | |
| 10 | if (__builtin_cpu_supports ("avx2")) |
| 11 | { |
| 12 | unsigned int eax, ebx, ecx, edx; |
| 13 | |
| 14 | if (!__get_cpuid_count (7, 0, &eax, &ebx, &ecx, &edx)) |
| 15 | __builtin_abort (); |
| 16 | |
| 17 | if (!(ebx & bit_AVX2)) |
| 18 | __builtin_abort (); |
| 19 | } |
| 20 | |
| 21 | return 0; |
| 22 | } |