Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / strlen.f90
blob85f233ff7518c9ee1a30632b0ebbad9bc2eee5da
1 ! Program to test the LEN and LEN_TRIM intrinsics.
2 subroutine test (c)
3 character(*) c
4 character(len(c)) d
6 d = c
7 if (len(d) .ne. 20) STOP 1
8 if (d .ne. "Longer Test String") STOP 2
9 c = "Hello World"
10 end subroutine
12 subroutine test2 (c)
13 character (*) c
14 character(len(c)) d
16 d = c
17 if (len(d) .ne. 6) STOP 3
18 if (d .ne. "Foobar") STOP 4
19 end subroutine
21 program strlen
22 implicit none
23 character(20) c
24 character(5) a, b
25 integer i
27 c = "Longer Test String"
28 call test (c)
30 if (len(c) .ne. 20) STOP 5
31 if (len_trim(c) .ne. 11) STOP 6
33 call test2 ("Foobar");
34 end program