1! { dg-do compile }
2! PR fortran/82796
3! Code contributed by ripero84 at gmail dot com
4module eq
5   implicit none
6   integer :: n1, n2
7   integer, dimension(2) :: a
8   equivalence (a(1), n1)
9   equivalence (a(2), n2)
10   common /a/ a
11end module eq
12
13module m
14   use eq
15   implicit none
16   type, public :: t
17     integer :: i
18   end type t
19end module m
20
21module p
22   implicit none
23   contains
24   pure integer function d(h)
25     use m
26     implicit none
27     integer, intent(in) :: h
28     d = h
29   end function
30end module p
31
32module q
33   implicit none
34   contains
35   pure integer function d(h)
36     use m, only : t
37     implicit none
38     integer, intent(in) :: h
39     d = h
40   end function
41end module q
42
43module r
44   implicit none
45   contains
46   pure integer function d(h)
47     use m, only : a          ! { dg-error "cannot be an EQUIVALENCE object" }
48     implicit none
49     integer, intent(in) :: h
50     d = h
51   end function
52end module r
53