summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/equiv_constraint_8.f90
blob: 1cb28b0318fea6c9c37913d0aef84e68c19f171d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
! { dg-do compile }
! { dg-options "-O0" }
! PR20899 - Common block variables cannot be equivalenced in a pure procedure.
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
common /z/ i
contains
pure integer function test(j)
  integer, intent(in) :: j
  common /z/ i
  integer :: k
  equivalence(i,k) ! { dg-error "EQUIVALENCE object in the pure" }
  k=1 ! { dg-error "variable definition context" }
  test=i*j
end function test
end