summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/common_equivalence_1.f
blob: bea51824f8c05f291694ceed5fc8677edc09eecd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
c { dg-do run }
c This program tests the fix for PR22304.
c
c provided by Paul Thomas - pault@gcc.gnu.org
c
      integer a(2), b, c
      COMMON /foo/ a
      EQUIVALENCE (a(1),b), (c, a(2))
      a(1) = 101
      a(2) = 102
      call bar ()
      END

      subroutine bar ()
      integer a(2), b, c, d
      COMMON /foo/ a
      EQUIVALENCE (a(1),b), (c, a(2))
      if (b.ne.101) STOP 1
      if (c.ne.102) STOP 2
      END