| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-fdec-structure" } |
| 3 |
! |
| 4 |
! Test UNIONs with array components. |
| 5 |
! |
| 6 |
|
| 7 |
subroutine aborts (s) |
| 8 |
character(*), intent(in) :: s |
| 9 |
print *, s |
| 10 |
STOP 1 |
| 11 |
end subroutine |
| 12 |
|
| 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 |
| 24 |
|
| 25 |
record /s5/ r5 |
| 26 |
|
| 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 |
| 40 |
|
| 41 |
end |