| 1 |
! { dg-do run } |
| 2 |
! Tests the fix for PR33370, in which array copying, with subreferences |
| 3 |
! was broken due to a regression. |
| 4 |
! |
| 5 |
! Reported by Thomas Koenig <[email protected]> |
| 6 |
! |
| 7 |
program main |
| 8 |
type foo |
| 9 |
integer :: i |
| 10 |
character(len=3) :: c |
| 11 |
end type foo |
| 12 |
type(foo), dimension(2) :: a = (/foo (1, "uvw"), foo (2, "xyz")/) |
| 13 |
type(foo), dimension(2) :: b = (/foo (101, "abc"), foo (102, "def")/) |
| 14 |
a%i = 0 |
| 15 |
print *, a |
| 16 |
a%i = (/ 12, 2/) |
| 17 |
if (any (a%c .ne. (/"uvw", "xyz"/))) STOP 1 |
| 18 |
if (any (a%i .ne. (/12, 2/))) STOP 2 |
| 19 |
a%i = b%i |
| 20 |
if (any (a%c .ne. (/"uvw", "xyz"/))) STOP 3 |
| 21 |
if (any (a%i .ne. (/101, 102/))) STOP 4 |
| 22 |
end program main |