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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [strlen.f90] - Diff between revs 303 and 338

Only display areas with differences | Details | Blame | View Log

Rev 303 Rev 338
! Program to test the LEN and LEN_TRIM intrinsics.
! Program to test the LEN and LEN_TRIM intrinsics.
subroutine test (c)
subroutine test (c)
   character(*) c
   character(*) c
   character(len(c)) d
   character(len(c)) d
   d = c
   d = c
   if (len(d) .ne. 20) call abort
   if (len(d) .ne. 20) call abort
   if (d .ne. "Longer Test String") call abort
   if (d .ne. "Longer Test String") call abort
   c = "Hello World"
   c = "Hello World"
end subroutine
end subroutine
subroutine test2 (c)
subroutine test2 (c)
   character (*) c
   character (*) c
   character(len(c)) d
   character(len(c)) d
   d = c
   d = c
   if (len(d) .ne. 6) call abort
   if (len(d) .ne. 6) call abort
   if (d .ne. "Foobar") call abort
   if (d .ne. "Foobar") call abort
end subroutine
end subroutine
program strlen
program strlen
   implicit none
   implicit none
   character(20) c
   character(20) c
   character(5) a, b
   character(5) a, b
   integer i
   integer i
   c = "Longer Test String"
   c = "Longer Test String"
   call test (c)
   call test (c)
   if (len(c) .ne. 20) call abort
   if (len(c) .ne. 20) call abort
   if (len_trim(c) .ne. 11) call abort
   if (len_trim(c) .ne. 11) call abort
   call test2 ("Foobar");
   call test2 ("Foobar");
end program
end program
 
 

powered by: WebSVN 2.1.0

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