Debian Codegraph @

gcc/testsuite/gfortran.dg/coarray/lock_1.f90

raw
1 ! { dg-do run }
2 !
3 ! LOCK/UNLOCK check
4 !
5 ! PR fortran/18918
6 !
7
8 use iso_fortran_env
9 implicit none
10
11 type(lock_type) :: lock[*]
12 integer :: stat
13 logical :: acquired
14
15 LOCK(lock)
16 UNLOCK(lock)
17
18 stat = 99
19 LOCK(lock, stat=stat)
20 if (stat /= 0) STOP 1
21 stat = 99
22 UNLOCK(lock, stat=stat)
23 if (stat /= 0) STOP 2
24
25 if (this_image() == 1) then
26 acquired = .false.
27 LOCK (lock[this_image()], acquired_lock=acquired)
28 if (.not. acquired) STOP 3
29 UNLOCK (lock[1])
30 end if
31 end
32