summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gfortran.dg/contained_equivalence_1.f90
blob: 7c6b0126cdbfb0252f01cc205f7454f1be11120f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
! { dg-do run }
! This program tests that equivalence only associates variables in
! the same scope.
!
! provided by Paul Thomas - pault@gcc.gnu.org
!
program contained_equiv
  real a
  a = 1.0
  call foo ()
  if (a.ne.1.0) call abort ()
contains
  subroutine foo ()
    real b
    equivalence (a, b)
    b = 2.0
  end subroutine foo
end program contained_equiv
OpenPOWER on IntegriCloud