Debian Codegraph @

gcc/testsuite/gfortran.dg/dependent_decls_3.f90

raw
1 ! { dg-do run }
2 !
3 ! Fix a regression caused by the fix for PR59104.
4 !
5 ! Contributed by Harald Anlauf <[email protected]>
6 !
7 program p
8 implicit none
9 integer, parameter :: nx = 64, ny = 32
10 real :: x(nx,ny), s(nx/2,ny), d(nx/2,ny)
11
12 s = 0.0
13 d = 0.0
14 call sub (x,s,d)
15 if (sum(s) .ne. 256) stop 1
16 if (sum(d) .ne. 256) stop 2 ! Stopped with sum(d) == 0.
17 contains
18 subroutine sub (v, w, d)
19 real, intent(in) :: v(:,:)
20 real, intent(out), dimension (size (v,dim=1)/4,size (v,dim=2)/2) :: w, d
21 w = 1.0
22 d = 1.0
23 if (any (shape (w) .ne. [nx/4, ny/2])) stop 3
24 if (any (shape (d) .ne. [nx/4, ny/2])) print *, shape (d) ! Printed "0 0" here
25 end subroutine sub
26 end