1! Program to test caracter string return values
2function test ()
3   implicit none
4   character(len=10) :: test
5   test = "World"
6end function
7
8function test2 () result (r)
9   implicit none
10   character(len=5) :: r
11   r = "Hello"
12end function
13
14program strret
15   implicit none
16   character(len=15) :: s
17   character(len=10) :: test
18   character(len=5) :: test2
19
20   s = test ()
21   if (s .ne. "World") call abort
22
23   s = "Hello " // test ()
24   if (s .ne. test2 () //" World") call abort
25end
26