gcc/testsuite/gfortran.dg/associate_38.f90
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! Test the fix for PR49636 in which the 'span' of 'ty1' was not used |
| 4 | ! in the descriptor of 'i'. |
| 5 | ! |
| 6 | ! Contributed by Fred Krogh <fkrogh#[email protected]> |
| 7 | ! |
| 8 | program test |
| 9 | type ty1 |
| 10 | integer :: k |
| 11 | integer :: i |
| 12 | end type ty1 |
| 13 | type ty2 |
| 14 | type(ty1) :: j(3) |
| 15 | end type ty2 |
| 16 | |
| 17 | type(ty2) t2 |
| 18 | t2%j(1:3)%i = [ 1, 3, 5 ] |
| 19 | associate (i=>t2%j%i) |
| 20 | if (any (t2%j(1:3)%i .ne. i(1:3))) stop 1 |
| 21 | end associate |
| 22 | end program test |