2 ! PR26766 Recursive I/O with internal units
3 ! Test case derived from example in PR
4 ! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
7 character (len
=8) :: str
, tmp
8 write (str
, '(a)') bar (1234)
9 if (str
.ne
."abcd") call abort()
11 write (str
, '(2a4)') foo (1), bar (1)
12 if (str
.ne
."abcdabcd") call abort()
16 function foo (i
) result (s
)
17 integer, intent(in
) :: i
18 character (len
=4) :: s
, t
22 ! Internal I/O, allowed recursive in f2003, see section 9.11
23 write (s
, '(a)') "abcd"
27 function bar (i
) result (s
)
28 integer, intent(in
) :: i
29 character (len
=4) :: s
, t
33 write (s
, '(a)') foo(i
)