aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/rtm-check.h
blob: 69788ad390ec6910ff099331e96aff15f1b180c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdlib.h>
#include "cpuid.h"
#ifdef DEBUG
#include <stdio.h>
#endif

static void rtm_test (void);

static void __attribute__ ((noinline)) do_test (void)
{
  rtm_test ();
}

int
main ()
{
  unsigned int eax, ebx, ecx, edx;

  if (!__get_cpuid_count (7, 0, &eax, &ebx, &ecx, &edx))
    return 0;

  /* Run RTM test only if host has RTM support.  */
  if (ebx & bit_RTM)
    {
      do_test ();
#ifdef DEBUG
      printf ("PASSED\n");
#endif
      return 0;
    }

#ifdef DEBUG
  printf ("SKIPPED\n");
#endif
  return 0;
}