OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [mapping_1.f90] - Diff between revs 302 and 384

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 302 Rev 384
! { dg-do run }
! { dg-do run }
! Tests the fix for PR31213, which exposed rather a lot of
! Tests the fix for PR31213, which exposed rather a lot of
! bugs - see the PR and the ChangeLog.
! bugs - see the PR and the ChangeLog.
!
!
! Contributed by Joost VandeVondele 
! Contributed by Joost VandeVondele 
!
!
module mykinds
module mykinds
  implicit none
  implicit none
  integer, parameter :: ik1 = selected_int_kind (2)
  integer, parameter :: ik1 = selected_int_kind (2)
  integer, parameter :: ik2 = selected_int_kind (4)
  integer, parameter :: ik2 = selected_int_kind (4)
  integer, parameter :: dp = selected_real_kind (15,300)
  integer, parameter :: dp = selected_real_kind (15,300)
end module mykinds
end module mykinds
module spec_xpr
module spec_xpr
  use mykinds
  use mykinds
  implicit none
  implicit none
  integer(ik2) c_size
  integer(ik2) c_size
contains
contains
  pure function tricky (str,ugly)
  pure function tricky (str,ugly)
    character(*), intent(in) :: str
    character(*), intent(in) :: str
    integer(ik1) :: ia_ik1(len(str))
    integer(ik1) :: ia_ik1(len(str))
    interface yoagly
    interface yoagly
      pure function ugly(n)
      pure function ugly(n)
        use mykinds
        use mykinds
        implicit none
        implicit none
        integer, intent(in) :: n
        integer, intent(in) :: n
        complex(dp) :: ugly(3*n+2)
        complex(dp) :: ugly(3*n+2)
      end function ugly
      end function ugly
    end interface yoagly
    end interface yoagly
    logical :: la(size (yoagly (size (ia_ik1))))
    logical :: la(size (yoagly (size (ia_ik1))))
    integer :: i
    integer :: i
    character(tricky_helper ((/(.TRUE., i=1, size (la))/)) + c_size) :: tricky
    character(tricky_helper ((/(.TRUE., i=1, size (la))/)) + c_size) :: tricky
    tricky = transfer (yoagly (1), tricky)
    tricky = transfer (yoagly (1), tricky)
  end function tricky
  end function tricky
  pure function tricky_helper (lb)
  pure function tricky_helper (lb)
    logical, intent(in) :: lb(:)
    logical, intent(in) :: lb(:)
    integer :: tricky_helper
    integer :: tricky_helper
    tricky_helper = 2 * size (lb) + 3
    tricky_helper = 2 * size (lb) + 3
  end function tricky_helper
  end function tricky_helper
end module spec_xpr
end module spec_xpr
module xtra_fun
module xtra_fun
  implicit none
  implicit none
contains
contains
  pure function butt_ugly(n)
  pure function butt_ugly(n)
    use mykinds
    use mykinds
    implicit none
    implicit none
    integer, intent(in) :: n
    integer, intent(in) :: n
    complex(dp) :: butt_ugly(3*n+2)
    complex(dp) :: butt_ugly(3*n+2)
    real(dp) pi, sq2
    real(dp) pi, sq2
    pi = 4 * atan (1.0_dp)
    pi = 4 * atan (1.0_dp)
    sq2 = sqrt (2.0_dp)
    sq2 = sqrt (2.0_dp)
    butt_ugly = cmplx (pi, sq2, dp)
    butt_ugly = cmplx (pi, sq2, dp)
  end function butt_ugly
  end function butt_ugly
end module xtra_fun
end module xtra_fun
program spec_test
program spec_test
  use mykinds
  use mykinds
  use spec_xpr
  use spec_xpr
  use xtra_fun
  use xtra_fun
  implicit none
  implicit none
  character(54) :: chr
  character(54) :: chr
  c_size = 5
  c_size = 5
  if (tricky ('Help me', butt_ugly) .ne. transfer (butt_ugly (1), chr)) call abort ()
  if (tricky ('Help me', butt_ugly) .ne. transfer (butt_ugly (1), chr)) call abort ()
end program spec_test
end program spec_test
! { dg-final { cleanup-modules "mykinds spec_xpr xtra_fun" } }
! { dg-final { cleanup-modules "mykinds spec_xpr xtra_fun" } }
 
 

powered by: WebSVN 2.1.0

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