2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / dec_structure_16.f90
blobf9b267110e832158c40b05cec0bb1453fc8729d7
1 ! { dg-do compile }
2 ! { dg-options "-fdec-structure" }
4 ! PR fortran/77782
6 ! Test an ICE where a union might be considered equal to a structure,
7 ! causing the union's backend_decl to be replaced with that of the structure.
10 program p
12 structure /s1/
13 union
14 map
15 integer(4) a
16 end map
17 map
18 real(4) b
19 end map
20 end union
21 end structure
23 structure /s2/
24 union ! regression: if this union == s1, we ICE in gfc_get_union_type
25 map
26 integer(2) x, y
27 integer(4) z
28 end map
29 end union
30 end structure
32 record /s1/ r1
33 r1.a = 0
35 end