URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
! Test optional character arguments. We still need to pass a string
|
! Test optional character arguments. We still need to pass a string
|
! length for the absent arguments
|
! length for the absent arguments
|
program optional_string_1
|
program optional_string_1
|
implicit none
|
implicit none
|
|
|
call test(1, "test");
|
call test(1, "test");
|
call test(2, c=42, b="Hello World")
|
call test(2, c=42, b="Hello World")
|
contains
|
contains
|
subroutine test(i, a, b, c)
|
subroutine test(i, a, b, c)
|
integer :: i
|
integer :: i
|
character(len=4), optional :: a
|
character(len=4), optional :: a
|
character(len=*), optional :: b
|
character(len=*), optional :: b
|
integer, optional :: c
|
integer, optional :: c
|
if (i .eq. 1) then
|
if (i .eq. 1) then
|
if (a .ne. "test") call abort
|
if (a .ne. "test") call abort
|
else
|
else
|
if (b .ne. "Hello World") call abort
|
if (b .ne. "Hello World") call abort
|
if (c .ne. 42) call abort
|
if (c .ne. 42) call abort
|
end if
|
end if
|
end subroutine
|
end subroutine
|
end program
|
end program
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.