| 1 |
! { dg-do run } |
| 2 |
! Check the fix for PR32129 #4 in which the argument 'vec(vy(i, :))' was |
| 3 |
! incorrectly simplified, resulting in an ICE. |
| 4 |
! |
| 5 |
! Reported by Francois-Xavier Coudert <[email protected]> |
| 6 |
! |
| 7 |
program testCode |
| 8 |
implicit none |
| 9 |
type vec |
| 10 |
real, dimension(2) :: coords |
| 11 |
end type |
| 12 |
integer :: i |
| 13 |
real, dimension(2,2), parameter :: vy = reshape ((/1,2,3,4/),(/2,2/)) |
| 14 |
i = 1 |
| 15 |
if (any (foo(vec(vy(i, :))) /= vy(i, :))) STOP 1 |
| 16 |
|
| 17 |
contains |
| 18 |
|
| 19 |
function foo (xin) |
| 20 |
type(vec) :: xin |
| 21 |
real, dimension (2) :: foo |
| 22 |
intent(in) xin |
| 23 |
foo = xin%coords |
| 24 |
end function |
| 25 |
end program |