URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [generic_9.f90] - Rev 694
Compare with Previous | Blame | View Log
! { dg-do compile }! Test the patch for PR29992. The standard requires that a! module procedure be contained in the same scope as the! interface or is use associated to it(12.3.2.1).!! Contributed by Daniel Franke <franke.daniel@gmail.com>!MODULE class_foo_typeTYPE :: fooINTEGER :: dummyEND TYPEcontainsSUBROUTINE bar_init_set_int(this, value)TYPE(foo), INTENT(out) :: thisinteger, intent(in) :: valuethis%dummy = valueEND SUBROUTINEEND MODULEMODULE class_fooUSE class_foo_type, ONLY: foo, bar_init_set_intINTERFACE foo_initMODULE PROCEDURE foo_init_default ! { dg-error "is not a module procedure" }END INTERFACEINTERFACE bar_initMODULE PROCEDURE bar_init_default, bar_init_set_int ! These are OKEND INTERFACEINTERFACESUBROUTINE foo_init_default(this)USE class_foo_type, ONLY: fooTYPE(foo), INTENT(out) :: thisEND SUBROUTINEEND INTERFACEcontainsSUBROUTINE bar_init_default(this)TYPE(foo), INTENT(out) :: thisthis%dummy = 42END SUBROUTINEEND MODULE! { dg-final { cleanup-modules "class_foo_type class_foo" } }
