1 /* { dg-do run { xfail *-*-* } }
3 /* Tests that new transactions can be started from both transaction_pure and
4 transaction_unsafe code. This also requires proper handling of reentrant
5 nesting in the serial_lock implementation. */
13 int __attribute__((transaction_pure)) pure(int i)
15 __transaction_atomic {
18 if (_ITM_inTransaction() == outsideTransaction)
23 int __attribute__((transaction_unsafe)) unsafe(int i)
25 if (_ITM_inTransaction() != inIrrevocableTransaction)
27 __transaction_atomic {
30 if (_ITM_inTransaction() != inIrrevocableTransaction)
35 static void *thread (void *dummy __attribute__((unused)))
37 __transaction_atomic {
40 __transaction_relaxed {
51 __transaction_atomic {
54 __transaction_relaxed {
60 // Spawn a new thread to check that the serial lock is not held.
61 pthread_create(&pt, NULL, thread, NULL);
62 pthread_join(pt, NULL);