2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / adx-check.h
blob580cb49ed439c620b281c4f5cec68dd81051aaf1
1 #include <stdlib.h>
2 #include "cpuid.h"
4 static void adx_test (void);
6 static void __attribute__ ((noinline)) do_test (void)
8 adx_test ();
11 int
12 main ()
14 unsigned int eax, ebx, ecx, edx;
16 if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
17 return 0;
19 /* Run ADX test only if host has ADX support. */
21 if (__get_cpuid_max (0, NULL) < 7)
22 return 0;
24 __cpuid_count (7, 0, eax, ebx, ecx, edx);
26 if ((ebx & bit_ADX) == bit_ADX)
28 do_test ();
29 #ifdef DEBUG
30 printf ("PASSED\n");
31 #endif
32 return 0;
34 #ifdef DEBUG
35 printf ("SKIPPED\n");
36 #endif
38 return 0;