1! { dg-do compile }
2! Tests the fix for PR29422, in which function results
3! were not tested for suitability in IO statements.
4!
5! Contributed by Dominique d'Humieres  <dominiq@lps.ens.fr>
6!
7Type drv
8 Integer :: i
9 Integer, allocatable :: arr(:)
10End type drv
11
12  print *, fun1 () ! { dg-error "cannot have ALLOCATABLE" }
13
14contains
15  Function fun1 ()
16
17    Type(drv) :: fun1
18    fun1%i = 10
19  end function fun1
20end
21
22