2 /* { dg-options "-pthread" } */
3 /* { dg-xfail-if "" { *-*-* } { "*" } { "" } } */
4 /* Tests static constructors inside of transactional code. */
9 int f(int x) __attribute__((noinline,transaction_safe));
16 static void *thread (void *)
19 __transaction_atomic { bar = f(10); }
29 // First, initialize y in another thread.
31 pthread_create(&pt, NULL, thread, NULL);
32 pthread_join(pt, NULL);
34 // Now y should already be initialized.
35 __transaction_atomic { bar = f(20); }