Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / intrinsic_len.f90
blob9db8d407a941e9c761a8fc008025d4dbcfb8658b
1 ! Program to test the LEN intrinsic
2 program test
3 character(len=10) a
4 character(len=8) w
5 type person
6 character(len=10) name
7 integer age
8 end type person
9 type(person) Tom
10 integer n
11 a = w (n)
13 if ((a .ne. "01234567") .or. (n .ne. 8)) call abort
14 if (len(Tom%name) .ne. 10) call abort
15 call array_test()
16 end
18 function w(i)
19 character(len=8) w
20 integer i
21 w = "01234567"
22 i = len(w)
23 end
25 ! This is the testcase from PR 15211 converted to a subroutine
26 subroutine array_test
27 implicit none
28 character(len=10) a(4)
29 if (len(a) .NE. 10) call abort()
30 end subroutine array_test