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