1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests module procedures declared and defined in the same module.
4 ! These cases are correct.
7 integer module function f1(x
)
10 integer module function f2(x
)
13 module function f3(x
) result(res
)
17 module function f4(x
) result(res
)
23 pure
module subroutine s2
29 integer module function f1(x
)
36 module function f3(x
) result(res
)
46 pure
module subroutine s2
56 integer module function f1(x
)
59 integer module function f2(x
)
62 module function f3(x
) result(res
)
66 module function f4(x
) result(res
)
72 pure
module subroutine s2
76 integer module function f1(x
)
77 !ERROR: Dummy argument 'x' has type INTEGER(4); the corresponding argument in the interface body has type REAL(4)
78 integer, intent(in
) :: x
81 !ERROR: 'notf2' was not declared a separate module procedure
82 module procedure notf2
84 !ERROR: Return type of function 'f3' does not match return type of the corresponding interface body
85 module function f3(x
) result(res
)
90 !ERROR: Module subroutine 'f4' was declared as a function in the corresponding interface body
93 !ERROR: Module function 's1' was declared as a subroutine in the corresponding interface body
96 !ERROR: Module subprogram 's2' and its corresponding interface body are not both PURE
97 impure
module subroutine s2