Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pclmul-avx-check.h
blob550e49904d9b72a721b07f43d675fa6b7ee9551f
1 #ifdef DEBUG
2 #include <stdio.h>
3 #endif
4 #include <stdlib.h>
5 #include "cpuid.h"
7 static void pclmul_avx_test (void);
9 static void
10 __attribute__ ((noinline))
11 do_test (void)
13 pclmul_avx_test ();
16 int
17 main ()
19 unsigned int eax, ebx, ecx, edx;
21 if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
22 return 0;
24 /* Run PCLMUL + AVX test only if host has PCLMUL + AVX support. */
25 if ((ecx & (bit_AVX | bit_PCLMUL)) == (bit_AVX | bit_PCLMUL))
27 do_test ();
28 #ifdef DEBUG
29 printf ("PASSED\n");
30 #endif
32 #ifdef DEBUG
33 else
34 printf ("SKIPPED\n");
35 #endif
37 return 0;