1! { dg-do compile }
2! { dg-options "-std=f2003" }
3!
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.
7!
8! Contributed by Paul Thomas  <pault@gcc.gnu.org>
9!
10 module foo_interface
11   implicit none
12
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
20
21!
22  SUBMODULE (foo_interface) foo_interface_son ! { dg-error "SUBMODULE declaration" }
23!
24  contains ! { dg-error "CONTAINS statement without FUNCTION or SUBROUTINE" }
25
26     module function array1 (this) result(that) ! { dg-error "MODULE prefix" }
27     end function ! { dg-error "Expecting END PROGRAM" }
28
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" }
33
34  end SUBMODULE foo_interface_son ! { dg-error "Expecting END PROGRAM" }
35
36end
37
38