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] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 303 jeremybenn
! Test optional character arguments.  We still need to pass a string
2
! length for the absent arguments
3
program optional_string_1
4
  implicit none
5
 
6
  call test(1, "test");
7
  call test(2, c=42, b="Hello World")
8
contains
9
subroutine test(i, a, b, c)
10
  integer ::  i
11
  character(len=4), optional :: a
12
  character(len=*), optional :: b
13
  integer, optional :: c
14
  if (i .eq. 1) then
15
    if (a .ne. "test") call abort
16
  else
17
    if (b .ne. "Hello World") call abort
18
    if (c .ne. 42) call abort
19
  end if
20
end subroutine
21
end program

powered by: WebSVN 2.1.0

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