Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.target / i386 / rtm-check.h
1 #include <stdlib.h>
2 #include "cpuid.h"
3
4 static void rtm_test (void);
5
6 static void __attribute__ ((noinline)) do_test (void)
7 {
8   rtm_test ();
9 }
10
11 int
12 main ()
13 {
14   unsigned int eax, ebx, ecx, edx;
15
16   if (__get_cpuid_max (0, NULL) >= 7)
17     {
18       __cpuid_count (7, 0, eax, ebx, ecx, edx);
19       if (ebx & bit_RTM)
20         {
21           do_test ();
22 #ifdef DEBUG
23           printf ("PASSED\n");
24 #endif
25           return 0;
26         }
27     }
28 #ifdef DEBUG
29   printf ("SKIPPED\n");
30 #endif
31   return 0;
32 }