1#include <stdlib.h>
2#include "cpuid.h"
3
4static void rtm_test (void);
5
6static void __attribute__ ((noinline)) do_test (void)
7{
8  rtm_test ();
9}
10
11int
12main ()
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}
33