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/] [dynamic_dispatch_7.f03] - Rev 302
Compare with Previous | Blame | View Log
! { dg-do run }! Test the fix for PR43291, which was a regression that caused! incorrect type mismatch errors at line 46. In the course of! fixing the PR, it was noted that the dynamic dispatch of the! final typebound call was not occurring - hence the dg-do run.!! Contributed by Janus Weil <janus@gcc.gnu.org>!module m1type :: t1containsprocedure :: sizeofend typecontainsinteger function sizeof(a)class(t1) :: asizeof = 1end function sizeofend modulemodule m2use m1type, extends(t1) :: t2containsprocedure :: sizeof => sizeof2end typecontainsinteger function sizeof2(a)class(t2) :: asizeof2 = 2end functionend modulemodule m3use m2type :: t3class(t1), pointer :: acontainsprocedure :: sizeof => sizeof3end typecontainsinteger function sizeof3(a)class(t3) :: asizeof3 = a%a%sizeof()end functionend moduleuse m1use m2use m3type(t1), target :: xtype(t2), target :: ytype(t3) :: zz%a => xif ((z%sizeof() .ne. 1) .or. (z%a%sizeof() .ne. 1)) call abortz%a => yif ((z%sizeof() .ne. 2) .or. (z%a%sizeof() .ne. 2)) call abortend! { dg-final { cleanup-modules "m1 m2 m3" } }
