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