fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / equiv_constraint_9.f90
blob0e4e832c4b0b3f3c9cf500f8e3dd45534ec0d808
1 ! { dg-do compile }
3 ! PR fortran/34655
5 ! Check for F2003's 5.5.2.5 Restrictions on common and equivalence
6 ! Test case contributed by Joost VandeVondele.
8 implicit none
9 type data_type
10 sequence
11 integer :: I = 7
12 end type data_type
15 type data_type2
16 sequence
17 integer :: I
18 end type data_type2
20 type(data_type) :: dd, ff
21 type(data_type2) :: gg
22 integer :: j, k, m
23 EQUIVALENCE(dd,J) ! { dg-error "with default initialization cannot be in EQUIVALENCE with a variable in COMMON" }
24 EQUIVALENCE(ff,k)
25 EQUIVALENCE(gg,m)
26 COMMON /COM/ j
27 COMMON /COM/ m
28 END