PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / submodule_3.f08
blob26a2217d28af0795c2415174b8301cc5813c2d6d
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 ! { dg-error "CONTAINS statement without FUNCTION or SUBROUTINE" }
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