OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [strlen.f90] - Blame information for rev 304

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 303 jeremybenn
! Program to test the LEN and LEN_TRIM intrinsics.
2
subroutine test (c)
3
   character(*) c
4
   character(len(c)) d
5
 
6
   d = c
7
   if (len(d) .ne. 20) call abort
8
   if (d .ne. "Longer Test String") call abort
9
   c = "Hello World"
10
end subroutine
11
 
12
subroutine test2 (c)
13
   character (*) c
14
   character(len(c)) d
15
 
16
   d = c
17
   if (len(d) .ne. 6) call abort
18
   if (d .ne. "Foobar") call abort
19
end subroutine
20
 
21
program strlen
22
   implicit none
23
   character(20) c
24
   character(5) a, b
25
   integer i
26
 
27
   c = "Longer Test String"
28
   call test (c)
29
 
30
   if (len(c) .ne. 20) call abort
31
   if (len_trim(c) .ne. 11) call abort
32
 
33
   call test2 ("Foobar");
34
end program

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.