aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/associate_38.f90
blob: 27a6f4b556baeb243911f62a993096f7941196a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do run }
!
! Test the fix for PR49636 in which the 'span' of 'ty1' was not used
! in the descriptor of 'i'.
!
! Contributed by Fred Krogh  <fkrogh#gcc@mathalacarte.com>
!
program test
  type ty1
    integer :: k
    integer :: i
  end type ty1
  type ty2
    type(ty1) :: j(3)
  end type ty2

  type(ty2) t2
  t2%j(1:3)%i = [ 1, 3, 5 ]
  associate (i=>t2%j%i)
    if (any (t2%j(1:3)%i .ne. i(1:3))) stop 1
  end associate
end program test