2015-07-02 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / submodule_3.f90
blob9d6c8d28e3a2ef17f2b5f8e32514d1cd010950f4
1 ! { dg-do compile }
2 ! { dg-options "-std=f2003" }
4 ! Check enforcement of F2008 standard for MODULE PROCEDURES and SUBMODULES
5 ! This is rather bare-bones to reduce the number of error messages too the
6 ! essential minimum.
8 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
10 module foo_interface
11 implicit none
13 interface
14 module function array1(this) result (that) ! { dg-error "MODULE prefix" }
15 end function ! { dg-error "Expecting END INTERFACE" }
16 character(16) module function array2(this, that) ! { dg-error "MODULE prefix" }
17 end function ! { dg-error "Expecting END INTERFACE" }
18 end interface
19 end module
22 SUBMODULE (foo_interface) foo_interface_son ! { dg-error "SUBMODULE declaration" }
24 contains
26 module function array1 (this) result(that) ! { dg-error "MODULE prefix" }
27 end function ! { dg-error "Expecting END PROGRAM" }
29 ! Test array characteristics for dummy and result are OK for
30 ! abbreviated module procedure declaration.
31 module procedure array2 ! { dg-error "must be in a generic module interface" }
32 end PROCEDURE ! { dg-error "Expecting END PROGRAM" }
34 end SUBMODULE foo_interface_son ! { dg-error "Expecting END PROGRAM" }
36 end ! { dg-error "CONTAINS statement without FUNCTION or SUBROUTINE" }