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/] [internal_pack_10.f90] - Diff between revs 302 and 384

Only display areas with differences | Details | Blame | View Log

Rev 302 Rev 384
! { dg-do run }
! { dg-do run }
! Test the fix for PR43180, in which patch which reduced the use of
! Test the fix for PR43180, in which patch which reduced the use of
! internal_pack/unpack messed up the passing of ru(1)%c as the actual
! internal_pack/unpack messed up the passing of ru(1)%c as the actual
! argument at line 23 in this testcase.
! argument at line 23 in this testcase.
!
!
! Contributed by Harald Anlauf 
! Contributed by Harald Anlauf 
! further reduced by Tobias Burnus 
! further reduced by Tobias Burnus 
!
!
module mo_obs_rules
module mo_obs_rules
  type t_set
  type t_set
     integer :: use = 42
     integer :: use = 42
  end type t_set
  end type t_set
  type t_rules
  type t_rules
     character(len=40) :: comment
     character(len=40) :: comment
     type(t_set)       :: c (1)
     type(t_set)       :: c (1)
  end type t_rules
  end type t_rules
  type (t_rules), save :: ru (1)
  type (t_rules), save :: ru (1)
contains
contains
  subroutine get_rule (c)
  subroutine get_rule (c)
    type(t_set) :: c (:)
    type(t_set) :: c (:)
    ru(1)%c(:)%use = 99
    ru(1)%c(:)%use = 99
    if (any (c(:)%use .ne. 42)) call abort
    if (any (c(:)%use .ne. 42)) call abort
    call set_set_v (ru(1)%c, c)
    call set_set_v (ru(1)%c, c)
    if (any (c(:)%use .ne. 99)) call abort
    if (any (c(:)%use .ne. 99)) call abort
  contains
  contains
    subroutine set_set_v (src, dst)
    subroutine set_set_v (src, dst)
      type(t_set), intent(in)    :: src(1)
      type(t_set), intent(in)    :: src(1)
      type(t_set), intent(inout) :: dst(1)
      type(t_set), intent(inout) :: dst(1)
    if (any (src%use .ne. 99)) call abort
    if (any (src%use .ne. 99)) call abort
    if (any (dst%use .ne. 42)) call abort
    if (any (dst%use .ne. 42)) call abort
      dst = src
      dst = src
    end subroutine set_set_v
    end subroutine set_set_v
  end subroutine get_rule
  end subroutine get_rule
end module mo_obs_rules
end module mo_obs_rules
program test
program test
  use mo_obs_rules
  use mo_obs_rules
  type(t_set) :: c (1)
  type(t_set) :: c (1)
  call get_rule (c)
  call get_rule (c)
end program test
end program test
! { dg-final { cleanup-modules "mo_obs_rules" } }
! { dg-final { cleanup-modules "mo_obs_rules" } }
 
 

powered by: WebSVN 2.1.0

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