summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr81889.f90
blob: 0516922ceb962bd1b7bebce23fbbd3c221276014 (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
! { dg-do compile }
! { dg-options "-O3 -Wall" }

module m

   type t
      integer, dimension(:), pointer :: list
   end type

contains

   subroutine s(n, p, Y)
      integer, intent(in) :: n
      type(t) :: p
      real, dimension(:) :: Y

      real, dimension(1:16) :: xx

      if (n > 3) then
         xx(1:n) = 0.
         print *, xx(1:n)
      else
         xx(1:n) = Y(p%list(1:n)) ! { dg-bogus "uninitialized" }
         print *, sum(xx(1:n))
      end if

   end subroutine

end module