blob: d6129977ad410d87c4ada395cd01656fb7d40270 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
! { dg-do run }
!
! Test the fix for PR56691 comment #7 (and comment #0).
!
! Reduced from the original of Marco Restelli <mrestelli@gmail.com>
! by Janus Weil <janus@gcc.gnu.org>
!
module m2
implicit none
type :: t_stv
real :: f1
end type
contains
subroutine lcb(y)
class(t_stv), intent(in) :: y(:)
integer :: k
do k=1,size(y)
if (int(y(k)%f1) .ne. k) STOP 1
enddo
end subroutine
end module
program test
use m2
implicit none
type(t_stv), allocatable :: work(:)
allocate(work(4))
work(:)%f1 = (/ 1.,2.,3.,4./)
call lcb(work)
call lcb(work(:4)) ! Indexing used to be offset by 1.
end program
|