| 1 |
! { dg-do run } |
| 2 |
! PR 31196 - reshape of transposed derived types generated |
| 3 |
! wront results. |
| 4 |
program main |
| 5 |
implicit none |
| 6 |
TYPE datatype |
| 7 |
INTEGER :: I |
| 8 |
END TYPE datatype |
| 9 |
character (len=20) line1, line2 |
| 10 |
TYPE(datatype), dimension(2,2) :: data, result |
| 11 |
data(1,1)%i = 1 |
| 12 |
data(2,1)%i = 2 |
| 13 |
data(1,2)%i = 3 |
| 14 |
data(2,2)%i = 4 |
| 15 |
write (unit=line1, fmt="(4I4)") reshape(transpose(data),shape(data)) |
| 16 |
write (unit=line2, fmt="(4I4)") (/ 1, 3, 2, 4 /) |
| 17 |
if (line1 /= line2) STOP 1 |
| 18 |
END program main |