1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! This test checks for semantic errors in lock statements based on the
3 ! statement specification in section 11.6.10 of the Fortran 2018 standard.
6 use iso_fortran_env
, only
: lock_type
9 character(len
=128) error_message
12 type(lock_type
) :: lock_var
[*]
14 !___ non-standard-conforming statements ___
16 ! missing required lock-variable
25 lock(acquired_lock
=bool
)
31 lock(errmsg
=error_message
)
33 ! specifiers in lock-stat-list are not variables
36 lock(lock_var
, acquired_lock
=.true
.)
39 lock(lock_var
, stat
=1)
42 lock(lock_var
, errmsg
='c')
47 lock(lock_var
, acquiredlock
=bool
, stat
=status
, errmsg
=error_message
)
50 lock(lock_var
, acquired_lock
=bool
, status
=status
, errmsg
=error_message
)
53 lock(lock_var
, acquired_lock
=bool
, stat
=status
, errormsg
=error_message
)
55 end program test_lock_stmt