1 /* { dg-do run { target { powerpc*-*-* && htm_hw } } } */
2 /* { dg-require-effective-target powerpc_htm_ok } */
3 /* { dg-options "-mhtm" } */
5 /* Program to test PowerPC HTM instructions. */
14 unsigned long mask
= 0;
15 unsigned long retry_count
= 0;
18 if (__builtin_tbegin (0))
25 /* Retry a limited number of times before aborting. */
26 if (retry_count
++ < 10)
33 __builtin_tsuspend ();
35 if (_HTM_STATE (__builtin_tcheck ()) != _HTM_SUSPENDED
)
40 if (_HTM_STATE (__builtin_tcheck ()) != _HTM_TRANSACTIONAL
)
46 if (_HTM_STATE (__builtin_tendall ()) != _HTM_TRANSACTIONAL
)
52 if (_HTM_STATE (__builtin_tendall ()) != _HTM_NONTRANSACTIONAL
)