Rebase.
[official-gcc.git] / gcc / testsuite / gfortran.dg / derived_external_function_1.f90
blob7421c4c0f221880e02883f908c28ee9005d927ec
1 ! { dg-do run }
3 ! PR fortran/58771
5 ! Contributed by Vittorio Secca <zeccav@gmail.com>
7 ! ICEd on the write statement with f() because the derived type backend
8 ! declaration not built.
10 module m
11 type t
12 integer(4) g
13 end type
14 end
16 type(t) function f() result(ff)
17 use m
18 ff%g = 42
19 end
21 use m
22 character (20) :: line1, line2
23 type(t) f
24 write (line1, *) f()
25 write (line2, *) 42_4
26 if (line1 .ne. line2) call abort
27 end