view gcc/testsuite/gfortran.dg/derived_external_function_1.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 run }
!
! PR fortran/58771
!
! Contributed by Vittorio Secca  <zeccav@gmail.com>
!
! ICEd on the write statement with f() because the derived type backend
! declaration not built.
!
module m
  type t
    integer(4) g
  end type
end

type(t) function f() result(ff)
  use m
  ff%g = 42
end

  use m
  character (20) :: line1, line2
  type(t)  f
  write (line1, *) f()
  write (line2, *) 42_4
  if (line1 .ne. line2) STOP 1
end