| 1 |
! { dg-do compile } |
| 2 |
! This tests the fix for PR28885, in which multiple calls to a procedure |
| 3 |
! with different components of an array of derived types for an INTENT(OUT) |
| 4 |
! argument caused an ICE internal compiler error. This came about because |
| 5 |
! the compiler would lose the temporary declaration with each subsequent |
| 6 |
! call of the procedure. |
| 7 |
! |
| 8 |
! Reduced from the contribution by Drew McCormack <[email protected]> |
| 9 |
! |
| 10 |
program test |
| 11 |
type t |
| 12 |
integer :: i |
| 13 |
integer :: j |
| 14 |
end type |
| 15 |
type (t) :: a(5) |
| 16 |
call sub('one',a%j) |
| 17 |
call sub('two',a%i) |
| 18 |
contains |
| 19 |
subroutine sub(key,a) |
| 20 |
integer, intent(out) :: a(:) |
| 21 |
character(*),intent(in) :: key |
| 22 |
a = 1 |
| 23 |
end subroutine |
| 24 |
end program |