Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / equiv_constraint_5.f90
blob1eefa8121a49a40c063ca134fb2cf1bfe0899d07
1 ! { dg-do compile }
2 ! { dg-options "-O0" }
3 ! PR20902 - Structure with default initializer cannot be equivalence memeber.
4 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
5 TYPE T1
6 sequence
7 integer :: i=1
8 END TYPE T1
9 TYPE T2
10 sequence
11 integer :: i ! drop original initializer to pick up error below.
12 END TYPE T2
13 TYPE(T1) :: a1
14 TYPE(T2) :: a2
15 EQUIVALENCE(a1,a2) ! { dg-error "initializer cannot be an EQUIVALENCE" }
16 write(6,*) a1,a2
17 END