PR rtl-optimization/87918
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / bmi2-check.h
blobba91ef9b780bf0b19b5e0599c756b567537f4e00
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "cpuid.h"
5 static void bmi2_test (void);
7 static void
8 __attribute__ ((noinline))
9 do_test (void)
11 bmi2_test ();
14 int
15 main ()
17 unsigned int eax, ebx, ecx, edx;
19 if (!__get_cpuid_count (7, 0, &eax, &ebx, &ecx, &edx))
20 return 0;
22 /* Run BMI2 test only if host has BMI2 support. */
23 if (ebx & bit_BMI2)
25 do_test ();
26 #ifdef DEBUG
27 printf ("PASSED\n");
28 #endif
29 return 0;
32 #ifdef DEBUG
33 printf ("SKIPPED\n");
34 #endif
35 return 0;