3 ! Tests the fix for PR67564 in which allocate with source for an unlimited
4 ! polymorphic array and a character source would ICE.
6 ! Contributed by Neil Carlson <neil.n.carlson@gmail.com>
10 class(*), allocatable :: x(:)
13 character(kind = 1, len = 5) :: chr1(3) = ["one ","two ","three"]
14 character(kind = 4, len = 2) :: chr4(2) = [character(kind=4) :: 4_"ab", 4_"cd"]
15 real(8) :: r(2) = [1d0,2d0]
17 allocate (a%x(3), source = chr1)
19 allocate (a%x(2), source = chr4)
21 allocate (a%x(2), source = r)
26 select type (z => a%x)
28 if (any (z .ne. r)) call abort
29 type is (character(kind = 1, len = *))
30 if (any(z .ne. chr1)) call abort
31 type is (character(kind = 4, len = *))
32 if (any(z .ne. chr4)) call abort