1 ! RUN: %python %S/test_errors.py %s %flang_fc1
3 ! C1568 The procedure-name shall have been declared to be a separate module
4 ! procedure in the containing program unit or an ancestor of that program unit.
5 ! C1547 MODULE shall appear only in the function-stmt or subroutine-stmt of a
6 ! module subprogram or of a nonabstract interface body that is declared in the
7 ! scoping unit of a module or submodule.
10 module subroutine sub1(arg1
)
11 integer, intent(inout
) :: arg1
13 module integer function fun1()
23 !ERROR: 'missing1' was not declared a separate module procedure
24 module procedure missing1
26 !ERROR: 'missing2' was not declared a separate module procedure
27 module subroutine missing2
29 !ERROR: 't' was not declared a separate module procedure
32 !ERROR: 'i' was not declared a separate module procedure
39 module subroutine sub1(arg1
)
40 integer, intent(inout
) :: arg1
42 module integer function fun1()
47 !ERROR: Declaration of 'i' conflicts with its use as module procedure
50 !ERROR: 'missing1' was not declared a separate module procedure
51 module procedure missing1
53 !ERROR: 'missing2' was not declared a separate module procedure
54 module subroutine missing2
56 !ERROR: 't' is already declared in this scoping unit
57 !ERROR: 't' was not declared a separate module procedure
60 !ERROR: 'i' was not declared a separate module procedure
65 ! Separate module procedure defined in same module as declared
76 ! Separate module procedure defined in a submodule
96 !ERROR: 'c1547' is a MODULE procedure which must be declared within a MODULE or SUBMODULE
97 real module function c1547()