Fix gcc.c-torture/execute/ieee/cdivchkf.c on hpux
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / lock-1.f90
blob211160780499ae105e43ddb435467bda28e07bdd
1 ! { dg-do run }
3 use omp_lib
5 integer (kind = omp_nest_lock_kind) :: lock
6 logical :: l
8 l = .false.
9 call omp_init_nest_lock (lock)
10 if (omp_test_nest_lock (lock) .ne. 1) stop 1
11 if (omp_test_nest_lock (lock) .ne. 2) stop 2
12 !$omp parallel if (.false.) reduction (.or.:l)
13 ! In OpenMP 2.5 this was supposed to return 3,
14 ! but in OpenMP 3.0 the parallel region has a different
15 ! task and omp_*_lock_t are owned by tasks, not by threads.
16 if (omp_test_nest_lock (lock) .ne. 0) l = .true.
17 !$omp end parallel
18 if (l) stop 3
19 if (omp_test_nest_lock (lock) .ne. 3) stop 4
20 call omp_unset_nest_lock (lock)
21 call omp_unset_nest_lock (lock)
22 call omp_unset_nest_lock (lock)
23 call omp_destroy_nest_lock (lock)
24 end