OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [strlen.f90] - Rev 303

Compare with Previous | Blame | View Log

! Program to test the LEN and LEN_TRIM intrinsics.
subroutine test (c)
   character(*) c
   character(len(c)) d

   d = c
   if (len(d) .ne. 20) call abort
   if (d .ne. "Longer Test String") call abort
   c = "Hello World"
end subroutine

subroutine test2 (c)
   character (*) c
   character(len(c)) d

   d = c
   if (len(d) .ne. 6) call abort
   if (d .ne. "Foobar") call abort
end subroutine

program strlen
   implicit none
   character(20) c
   character(5) a, b
   integer i

   c = "Longer Test String"
   call test (c)

   if (len(c) .ne. 20) call abort
   if (len_trim(c) .ne. 11) call abort

   call test2 ("Foobar");
end program

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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