1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
4 ! C1568 The procedure-name shall have been declared to be a separate module
5 ! procedure in the containing program unit or an ancestor of that program unit.
6 ! C1547 MODULE shall appear only in the function-stmt or subroutine-stmt of a
7 ! module subprogram or of a nonabstract interface body that is declared in the
8 ! scoping unit of a module or submodule.
11 module subroutine sub1(arg1
)
12 integer, intent(inout
) :: arg1
14 module integer function fun1()
24 !ERROR: 'missing1' was not declared a separate module procedure
25 module procedure missing1
27 !ERROR: 'missing2' was not declared a separate module procedure
28 module subroutine missing2
30 !ERROR: 't' was not declared a separate module procedure
33 !ERROR: 'i' was not declared a separate module procedure
40 module subroutine sub1(arg1
)
41 integer, intent(inout
) :: arg1
43 module integer function fun1()
48 !ERROR: Declaration of 'i' conflicts with its use as module procedure
51 !ERROR: 'missing1' was not declared a separate module procedure
52 module procedure missing1
54 !ERROR: 'missing2' was not declared a separate module procedure
55 module subroutine missing2
57 !ERROR: 't' is already declared in this scoping unit
58 !ERROR: 't' was not declared a separate module procedure
61 !ERROR: 'i' was not declared a separate module procedure
66 ! Separate module procedure defined in same module as declared
77 ! Separate module procedure defined in a submodule
97 !ERROR: 'c1547' is a MODULE procedure which must be declared within a MODULE or SUBMODULE
98 real module function c1547()