summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/equiv_9.f90
blob: 28f0bb8bbf1400034e395dab53b466fc8e4ebf02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do run }
! PR fortran/66377
!
module constant
  integer x1, x2, x3
  integer x(3)
  equivalence (x(1),x1), (x2,x(2)), (x3,x(3))
end module

program test
  use constant
  implicit none 
  x = (/1, 2, 3/)
  call another()
end program

subroutine another()
   use constant, only : x2
   implicit none
   if (x2 /= 2) call abort
end subroutine
! { dg-final { cleanup-modules "constant" } }