URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [class_9.f03] - Rev 694
Compare with Previous | Blame | View Log
! { dg-do run }! Test the fix for PR41706, in which arguments of class methods that! were themselves class methods did not work.!! Contributed by Janus Weil <janus@gcc.gnu.org>!module mtype :: treal :: v = 1.5containsprocedure, nopass :: aprocedure, nopass :: bprocedure, pass :: cprocedure, nopass :: dend typecontainsreal function a (x)real :: xa = 2.*xend functionreal function b (x)real :: xb = 3.*xend functionreal function c (x)class (t) :: xc = 4.*x%vend functionsubroutine d (x)real :: xif (abs(x-3.0)>1E-3) call abort()end subroutinesubroutine s (x)class(t) :: xreal :: rr = x%a (1.1) ! workedif (r .ne. a (1.1)) call abortr = x%a (b (1.2)) ! workedif (r .ne. a(b (1.2))) call abortr = b ( x%a (1.3)) ! workedif (r .ne. b(a (1.3))) call abortr = x%a(x%b (1.4)) ! failedif (r .ne. a(b (1.4))) call abortr = x%a(x%c ()) ! failedif (r .ne. a(c (x))) call abortcall x%d (x%a(1.5)) ! failedend subroutineenduse mclass(t),allocatable :: xallocate(x)call s (x)end! { dg-final { cleanup-modules "m" } }
