Debian Codegraph @

gcc/testsuite/gcc.target/i386/rtm-check.h

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