2 ! { dg-options "-std=legacy" }
4 program char_pointer_func
5 ! Test assignments from character pointer functions, required
6 ! to fix PR17192 and PR17202
7 ! Provided by Paul Thomas pault@gcc.gnu.org
10 character*4, pointer :: c1
11 character*4, pointer :: c2(:)
13 ! Check that we have not broken non-pointer characters.
15 if (c0
/= "abcd") STOP 1
18 if (c1
/= "abcd") STOP 2
20 if (c2(1) /= "abcd") STOP 3
24 if (c1
/= "abcd") STOP 4
26 if (c2(1) /= "abcd") STOP 5
29 function foo () result (cc1
)
33 function sfoo () result (sc1
)
34 character*4, pointer :: sc1
38 function afoo (c0
) result (ac1
)
40 character*4, pointer :: ac1(:)
44 end program char_pointer_func