PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / dec_union_5.f90
blobf3cca5db96f0f48463f0fe2daad04b24b3d37cda
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) = z'41'
29 r5.a(2) = z'42'
30 r5.a(3) = z'43'
31 r5.a(4) = z'44'
32 r5.a(5) = z'45'
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