annotate gcc/testsuite/gfortran.dg/mapping_2.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! Tests the fix for PR33998, in which the chain of expressions
kono
parents:
diff changeset
3 ! determining the character length of my_string were not being
kono
parents:
diff changeset
4 ! resolved by the formal to actual mapping.
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
kono
parents:
diff changeset
7 !
kono
parents:
diff changeset
8 module test
kono
parents:
diff changeset
9 implicit none
kono
parents:
diff changeset
10 contains
kono
parents:
diff changeset
11 function my_string(x)
kono
parents:
diff changeset
12 integer i
kono
parents:
diff changeset
13 real, intent(in) :: x(:)
kono
parents:
diff changeset
14 character(0) h4(1:minval([(i,i=30,32), 15]))
kono
parents:
diff changeset
15 character(0) sv1(size(x,1):size(h4))
kono
parents:
diff changeset
16 character(0) sv2(2*lbound(sv1,1):size(h4))
kono
parents:
diff changeset
17 character(lbound(sv2,1)-3) my_string
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 do i = 1, len(my_string)
kono
parents:
diff changeset
20 my_string(i:i) = achar(modulo(i-1,10)+iachar('0'))
kono
parents:
diff changeset
21 end do
kono
parents:
diff changeset
22 end function my_string
kono
parents:
diff changeset
23 end module test
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 program len_test
kono
parents:
diff changeset
26 use test
kono
parents:
diff changeset
27 implicit none
kono
parents:
diff changeset
28 real x(7)
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 if (my_string(x) .ne. "01234567890") call abort ()
kono
parents:
diff changeset
31 end program len_test