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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [bounds_check_9.f90] - Blame information for rev 801

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-fbounds-check" }
3
! PR fortran/31119
4
!
5
module sub_mod
6
contains
7
elemental subroutine set_optional(i,idef,iopt)
8
  integer, intent(out) :: i
9
  integer, intent(in) :: idef
10
  integer, intent(in), optional :: iopt
11
  if (present(iopt)) then
12
    i = iopt
13
  else
14
    i = idef
15
  end if
16
  end subroutine set_optional
17
 
18
  subroutine sub(ivec)
19
    integer, intent(in), optional :: ivec(:)
20
    integer :: ivec_(2)
21
    call set_optional(ivec_,(/1,2/))
22
    if (any (ivec_ /= (/1, 2/))) call abort
23
    call set_optional(ivec_,(/1,2/),ivec)
24
    if (present (ivec)) then
25
      if (any (ivec_ /= ivec)) call abort
26
    else
27
      if (any (ivec_ /= (/1, 2/))) call abort
28
    end if
29
  end subroutine sub
30
end module sub_mod
31
 
32
program main
33
  use sub_mod, only: sub
34
  call sub()
35
  call sub((/4,5/))
36
end program main
37
! { dg-final { cleanup-modules "sub_mod" } }

powered by: WebSVN 2.1.0

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