PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / char_length_13.f90
blobdd5c05a858408b081502700ca34e87a6497a96bb
1 ! { dg-do compile }
3 ! PR fortran/38095
5 ! Contributed by Vivek Rao
7 ! Compiling the program below gave an ICE
9 module bar
10 implicit none
11 contains
12 elemental function trim_append(xx,yy) result(xy)
13 character (len=*), intent(in) :: xx,yy
14 character (len=len(xx) + len(yy)) :: xy
15 xy = trim(xx) // yy
16 end function trim_append
17 function same(xx) result(yy)
18 character (len=*), intent(in) :: xx(:)
19 character (len=len(xx)) :: yy(size(xx))
20 yy = [xx]
21 end function same
22 subroutine foo(labels)
23 character (len=*), intent(in) :: labels(:)
24 print*,"size(labels)=",size(labels)
25 end subroutine foo
26 subroutine xmain()
27 call foo(trim_append(["a"],same(["b"])))
28 end subroutine xmain
29 end module bar
31 program main
32 use bar
33 call xmain()
34 end program main