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

Subversion Repositories openrisc

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

Go to most recent revision | Compare with Previous | Blame | View Log

! Test optional character arguments.  We still need to pass a string
! length for the absent arguments
program optional_string_1
  implicit none

  call test(1, "test");
  call test(2, c=42, b="Hello World")
contains
subroutine test(i, a, b, c)
  integer ::  i
  character(len=4), optional :: a
  character(len=*), optional :: b
  integer, optional :: c
  if (i .eq. 1) then
    if (a .ne. "test") call abort
  else
    if (b .ne. "Hello World") call abort
    if (c .ne. 42) call abort
  end if
end subroutine
end program

Go to most recent revision | 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.