view gcc/testsuite/gfortran.dg/pr81889.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { 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