1#include <stdlib.h>
2#include "cpuid.h"
3#include "m256-check.h"
4
5static void avx_test (void);
6
7static void
8__attribute__ ((noinline))
9do_test (void)
10{
11  avx_test ();
12}
13
14int
15main ()
16{
17  unsigned int eax, ebx, ecx, edx;
18
19  if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
20    return 0;
21
22  /* Run AVX test only if host has AVX support.  */
23  if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
24    {
25      do_test ();
26#ifdef DEBUG
27      printf ("PASSED\n");
28#endif
29    }
30#ifdef DEBUG
31  else
32    printf ("SKIPPED\n");
33#endif
34
35  return 0;
36}
37