1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
4 ! case 1: ma_create_new_fun' was not declared a separate module procedure
8 module function ma_create_fun( ) result(this
)
14 submodule (m1
) ma_submodule
17 module function ma_create_fun() result(this
)
23 !ERROR: 'ma_create_new_fun' was not declared a separate module procedure
24 module function ma_create_new_fun() result(this
)
32 ! case 2: 'mb_create_new_sub' was not declared a separate module procedure
36 module subroutine mb_create_sub
37 end subroutine mb_create_sub
41 submodule (m2
) mb_submodule
44 module subroutine mb_create_sub
48 end subroutine mb_create_sub
50 !ERROR: 'mb_create_new_sub' was not declared a separate module procedure
51 module SUBROUTINE mb_create_new_sub()
55 end SUBROUTINE mb_create_new_sub
58 ! case 3: separate module procedure without module prefix
61 function mc_create( ) result(this
)
67 submodule (m3
) mc_submodule
69 !ERROR: 'mc_create' was not declared a separate module procedure
70 module function mc_create() result(this
)
75 ! case 4: Submodule having separate module procedure rather than a module
78 real module function func1() ! module procedure interface body for func1
85 module function func2(b
) ! module procedure interface body for func2
90 real module function func3() ! module procedure interface body for func3
94 real module function func1() ! implementation of func1 declared in m4
99 submodule (m4
:m4sub
) m4sub2
101 module function func2(b
) ! implementation of func2 declared in m4sub
107 real module function func3() ! implementation of func3 declared in m4sub