aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/equiv_pure.f90
blob: 052027940eca1e6e26e70e81bc06bc3444b7891e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
! { dg-do compile }
module eq
   implicit none
   integer :: n1, n2
   integer, dimension(2) :: a
   equivalence (a(1), n1)
   equivalence (a(2), n2)
   common /a/ a
end module eq

module m
   use eq
   implicit none
   type, public :: t
     integer :: i
   end type t
end module m

module p
   implicit none
   contains
   pure integer function d(h)
     use m
     implicit none
     integer, intent(in) :: h
     d = h
   end function
end module p

module q
   implicit none
   contains
   pure integer function d(h)
     use m, only : t
     implicit none
     integer, intent(in) :: h
     d = h
   end function
end module q

module r
   implicit none
   contains
   pure integer function d(h)
     use m, only : a          ! { dg-error "cannot be an EQUIVALENCE object" }
     implicit none
     integer, intent(in) :: h
     d = h
   end function
end module r