[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / lockstmt01.f90
blobfe2b7e7ba1e00577a4334c849251f26610366264
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.
5 program test_lock_stmt
6 use iso_fortran_env, only: lock_type
7 implicit none
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 ___
16 lock(lock_var)
17 lock(lock_var[1])
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