PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / aes-avx-check.h
blobf2a4ead401450434c364e0b3b6c8007f3869ddc8
1 #ifdef DEBUG
2 #include <stdio.h>
3 #endif
4 #include <stdlib.h>
5 #include "cpuid.h"
6 #include "avx-os-support.h"
8 static void aes_avx_test (void);
10 static void
11 __attribute__ ((noinline))
12 do_test (void)
14 aes_avx_test ();
17 int
18 main ()
20 unsigned int eax, ebx, ecx, edx;
22 if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
23 return 0;
25 /* Run AES + AVX test only if host has AES + AVX support. */
26 if (((ecx & (bit_AVX | bit_OSXSAVE | bit_AES))
27 == (bit_AVX | bit_OSXSAVE | bit_AES))
28 && avx_os_support ())
30 do_test ();
31 #ifdef DEBUG
32 printf ("PASSED\n");
33 #endif
35 #ifdef DEBUG
36 else
37 printf ("SKIPPED\n");
38 #endif
40 return 0;