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
, msg_array(10)
10 integer status
, stat_array(10)
11 logical bool
, bool_array
, coindexed_logical
[*]
12 type(lock_type
) :: lock_var
[*]
14 !___ standard-conforming statements ___
18 lock(lock_var
[this_image() + 1])
19 lock(lock_var
, acquired_lock
=bool
)
20 lock(lock_var
, acquired_lock
=bool_array(1))
21 lock(lock_var
, acquired_lock
=coindexed_logical
[1])
22 lock(lock_var
, stat
=status
)
23 lock(lock_var
, stat
=stat_array(1))
24 lock(lock_var
, errmsg
=error_message
)
25 lock(lock_var
, errmsg
=msg_array(1))
27 lock(lock_var
, stat
=status
, errmsg
=error_message
)
28 lock(lock_var
, errmsg
=error_message
, stat
=status
)
29 lock(lock_var
, acquired_lock
=bool
, stat
=status
)
30 lock(lock_var
, stat
=status
, acquired_lock
=bool
)
31 lock(lock_var
, acquired_lock
=bool
, errmsg
=error_message
)
32 lock(lock_var
, errmsg
=error_message
, acquired_lock
=bool
)
34 lock(lock_var
, acquired_lock
=bool
, stat
=status
, errmsg
=error_message
)
35 lock(lock_var
, acquired_lock
=bool
, errmsg
=error_message
, stat
=status
)
36 lock(lock_var
, stat
=status
, acquired_lock
=bool
, errmsg
=error_message
)
37 lock(lock_var
, stat
=status
, errmsg
=error_message
, acquired_lock
=bool
)
38 lock(lock_var
, errmsg
=error_message
, acquired_lock
=bool
, stat
=status
)
39 lock(lock_var
, errmsg
=error_message
, stat
=status
, acquired_lock
=bool
)
41 end program test_lock_stmt