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

Subversion Repositories openrisc

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

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

Rev 303 Rev 338
! Program to test static variable initialization
! Program to test static variable initialization
! returns the parameter from the previous invocation, or 42 on the first call.
! returns the parameter from the previous invocation, or 42 on the first call.
function test (parm)
function test (parm)
   implicit none
   implicit none
   integer test, parm
   integer test, parm
   integer :: val = 42
   integer :: val = 42
   test = val
   test = val
   val = parm
   val = parm
end function
end function
program intializer
program intializer
   implicit none
   implicit none
   integer test
   integer test
   character(11) :: c = "Hello World"
   character(11) :: c = "Hello World"
   character(15) :: d = "Teststring"
   character(15) :: d = "Teststring"
   integer, dimension(3) :: a = 1
   integer, dimension(3) :: a = 1
   if (any (a .ne. 1)) call abort
   if (any (a .ne. 1)) call abort
   if (test(11) .ne. 42) call abort
   if (test(11) .ne. 42) call abort
   ! The second call should return
   ! The second call should return
   if (test(0) .ne. 11) call abort
   if (test(0) .ne. 11) call abort
   if (c .ne. "Hello World") call abort
   if (c .ne. "Hello World") call abort
   if (d .ne. "Teststring") call abort
   if (d .ne. "Teststring") call abort
end program
end program
 
 

powered by: WebSVN 2.1.0

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