c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / dec_union_5.f90
blob712b9a437c6f60af86bf746ecd10279a116b9abd
1 ! { dg-do run }
2 ! { dg-options "-fdec-structure" }
4 ! Test UNIONs with array components.
7 subroutine aborts (s)
8 character(*), intent(in) :: s
9 print *, s
10 STOP 1
11 end subroutine
13 ! Unions with arrays
14 structure /s5/
15 union
16 map
17 character :: s(5)
18 end map
19 map
20 integer(1) :: a(5)
21 end map
22 end union
23 end structure
25 record /s5/ r5
27 ! Unions with arrays
28 r5.a(1) = int(z'41',1)
29 r5.a(2) = int(z'42',1)
30 r5.a(3) = int(z'43',1)
31 r5.a(4) =int( z'44',1)
32 r5.a(5) = int(z'45',1)
33 if ( r5.s(1) .ne. 'A' &
34 .or. r5.s(2) .ne. 'B' &
35 .or. r5.s(3) .ne. 'C' &
36 .or. r5.s(4) .ne. 'D' &
37 .or. r5.s(5) .ne. 'E') then
38 call aborts ("arrays")
39 endif
41 end