3 ! Testing fix for PR fortran/60255
5 ! Author: Andre Vehreschild <vehre@gmx.de>
10 subroutine bar (arg
, res
)
13 select
type (w
=> arg
)
14 type is (character(*))
15 write (res
, '(I2)') len(w
)
24 character(LEN
=:), allocatable
, target
:: S
25 character(LEN
=100) :: res
26 class(*), pointer :: ucp
, ucp2
27 call sub1 ("long test string", 16)
32 allocate (ucp2
, source
=ucp
)
35 call sub4 ("This is a longer string.", 24)
37 if (trim (res
) .NE
. " 4") call abort ()
39 if (trim (res
) .NE
. " 4") call abort ()
43 subroutine sub1(dcl
, ilen
)
44 character(len
=*), target
:: dcl
46 character(len
=:), allocatable
:: hlp
47 class(*), pointer :: ucp
52 type is (character(len
=*))
53 if (len(dcl
) .NE
. ilen
) call abort ()
54 if (len(ucp
) .NE
. ilen
) call abort ()
56 if (len(hlp
) .NE
. ilen
) call abort ()
63 character(len
=:), allocatable
, target
:: dcl
64 class(*), pointer :: ucp
70 type is (character(len
=*))
71 if (len(ucp
) .ne
. 3) call abort ()
78 character(len
=:), allocatable
:: hlp
79 class(*), pointer :: ucp
82 type is (character(len
=*))
83 if (len(ucp
) .ne
. 4) call abort ()
85 if (len(hlp
) .ne
. 4) call abort ()
91 subroutine sub4(ucp
, ilen
)
92 character(len
=:), allocatable
:: hlp
97 type is (character(len
=*))
98 if (len(ucp
) .ne
. ilen
) call abort ()
100 if (len(hlp
) .ne
. ilen
) call abort ()