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