1! { dg-do compile }
2! { dg-options "-fcoarray=lib" }
3!
4!
5use iso_fortran_env
6implicit none
7
8type t1
9  type(lock_type), allocatable :: x[:]
10end type t1
11
12type t2
13  type(lock_type) :: x
14end type t2
15
16type(t1) :: a
17type(t2) :: b[*]
18!class(lock_type), allocatable :: cl[:]
19
20lock(a%x) ! { dg-error "the lock component of derived type at \\(1\\) is not yet supported" }
21lock(b%x) ! { dg-error "the lock component of derived type at \\(1\\) is not yet supported" }
22!lock(cl)
23
24unlock(a%x) ! { dg-error "the lock component of derived type at \\(1\\) is not yet supported" }
25unlock(b%x) ! { dg-error "the lock component of derived type at \\(1\\) is not yet supported" }
26!unlock(cl)
27end
28