1 /* { dg-do run { target *-*-linux* } } */
11 pthread_barrier_t bar;
19 if (omp_test_nest_lock (&lock) != 1)
21 if (omp_test_nest_lock (&lock) != 2)
24 pthread_barrier_wait (&bar);
25 if (!p && omp_test_nest_lock (&lock) != 0)
27 pthread_barrier_wait (&bar);
30 if (omp_test_nest_lock (&lock) != 3)
32 omp_unset_nest_lock (&lock);
33 omp_unset_nest_lock (&lock);
34 omp_unset_nest_lock (&lock);
36 pthread_barrier_wait (&bar);
39 if (omp_test_nest_lock (&lock) != 1)
41 if (omp_test_nest_lock (&lock) != 2)
43 omp_unset_nest_lock (&lock);
44 omp_unset_nest_lock (&lock);
53 omp_init_nest_lock (&lock);
54 pthread_barrier_init (&bar, NULL, 2);
55 pthread_create (&th, NULL, tf, NULL);
57 pthread_join (th, NULL);
58 omp_destroy_nest_lock (&lock);