]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/testsuite/libgomp.fortran/lock-1.f90
re PR fortran/84381 (replace non-std 'call abort' by 'stop 1' in gfortran testsuite)
[thirdparty/gcc.git] / libgomp / testsuite / libgomp.fortran / lock-1.f90
CommitLineData
a68ab351
JJ
1! { dg-do run }
2
3 use omp_lib
4
5 integer (kind = omp_nest_lock_kind) :: lock
6 logical :: l
7
8 l = .false.
9 call omp_init_nest_lock (lock)
bfc24e32
TK
10 if (omp_test_nest_lock (lock) .ne. 1) STOP 1
11 if (omp_test_nest_lock (lock) .ne. 2) STOP 2
a68ab351
JJ
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
bfc24e32
TK
18 if (l) STOP 3
19 if (omp_test_nest_lock (lock) .ne. 3) STOP 4
a68ab351
JJ
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)
24end