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