1! { dg-do compile }
2! { dg-options "-fcoarray=lib -lcaf_single " }
3!
4! Test the fix for PR83076
5!
6module m
7   type t
8      integer, pointer :: z
9   end type
10   type(t) :: ptr
11contains
12   function g(x)
13      type(t) :: x[*]
14      if (associated (x%z, ptr%z)) deallocate (x%z) ! This used to ICE with -fcoarray=lib
15   end
16end module
17
18  use m
19contains
20   function f(x)
21      type(t) :: x[*]
22      if (associated (x%z, ptr%z)) deallocate (x%z)
23   end
24end
25