URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 303 |
Rev 384 |
! 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
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.