annotate gcc/testsuite/gfortran.dg/char_length_13.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! PR fortran/38095
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Contributed by Vivek Rao
kono
parents:
diff changeset
6 !
kono
parents:
diff changeset
7 ! Compiling the program below gave an ICE
kono
parents:
diff changeset
8 !
kono
parents:
diff changeset
9 module bar
kono
parents:
diff changeset
10 implicit none
kono
parents:
diff changeset
11 contains
kono
parents:
diff changeset
12 elemental function trim_append(xx,yy) result(xy)
kono
parents:
diff changeset
13 character (len=*), intent(in) :: xx,yy
kono
parents:
diff changeset
14 character (len=len(xx) + len(yy)) :: xy
kono
parents:
diff changeset
15 xy = trim(xx) // yy
kono
parents:
diff changeset
16 end function trim_append
kono
parents:
diff changeset
17 function same(xx) result(yy)
kono
parents:
diff changeset
18 character (len=*), intent(in) :: xx(:)
kono
parents:
diff changeset
19 character (len=len(xx)) :: yy(size(xx))
kono
parents:
diff changeset
20 yy = [xx]
kono
parents:
diff changeset
21 end function same
kono
parents:
diff changeset
22 subroutine foo(labels)
kono
parents:
diff changeset
23 character (len=*), intent(in) :: labels(:)
kono
parents:
diff changeset
24 print*,"size(labels)=",size(labels)
kono
parents:
diff changeset
25 end subroutine foo
kono
parents:
diff changeset
26 subroutine xmain()
kono
parents:
diff changeset
27 call foo(trim_append(["a"],same(["b"])))
kono
parents:
diff changeset
28 end subroutine xmain
kono
parents:
diff changeset
29 end module bar
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 program main
kono
parents:
diff changeset
32 use bar
kono
parents:
diff changeset
33 call xmain()
kono
parents:
diff changeset
34 end program main