| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Test the fix for PR102619. |
| 4 |
! |
| 5 |
! Contributed by Gerhard Steinmetz <[email protected]> |
| 6 |
! |
| 7 |
program p |
| 8 |
implicit none |
| 9 |
real :: w(2,3) |
| 10 |
real, allocatable :: y(:) |
| 11 |
y = h(w) ! Caused an ICE |
| 12 |
if (size (y) /= product (shape (w))) stop 1 |
| 13 |
if (any (int (y) /= [1,2,3,4,5,6])) stop 2 |
| 14 |
deallocate (y) |
| 15 |
contains |
| 16 |
function h(x) result (g) |
| 17 |
real :: x(..) |
| 18 |
real :: g(product(shape(x))) |
| 19 |
integer :: i |
| 20 |
if (any (shape (x) /= shape (w))) stop 3 |
| 21 |
g = [(real(i),i=1,size(g))] |
| 22 |
end |
| 23 |
end |