URL
                    https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
                
            Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [alloc_comp_assign_8.f90] - Rev 302
Compare with Previous | Blame | View Log
! { dg-do run }!! Test the fix for PR35824, in which the interface assignment and! negation did not work correctly.!! Contributed by Rolf Roth <everyo@gmx.net>!module typemoduletype alltypedouble precision :: adouble precision,allocatable :: b(:)end typeinterface assignment(=)module procedure at_from_atend interfaceinterface operator(-)module procedure neg_atend interfacecontainssubroutine at_from_at(b,a)type(alltype), intent(in) :: atype(alltype), intent(out) :: bb%a=a%aallocate(b%b(2))b%b=a%bend subroutine at_from_atfunction neg_at(a) result(b)type(alltype), intent(in) :: atype(alltype) :: bb%a=-a%aallocate(b%b(2))b%b=-a%bend function neg_atend moduleuse typemoduletype(alltype) t1,t2,t3allocate(t1%b(2))t1%a=0.5d0t1%b(1)=1d0t1%b(2)=2d0t2=-t1if (t2%a .ne. -0.5d0) call abortif (any(t2%b .ne. [-1d0, -2d0])) call abortt1=-t1if (t1%a .ne. -0.5d0) call abortif (any(t1%b .ne. [-1d0, -2d0])) call abortend! { dg-final { cleanup-modules "typemodule" } }

