1 ! RUN: %python %S/test_errors.py %s %flang_fc1
3 ! case 1: ma_create_new_fun' was not declared a separate module procedure
7 module function ma_create_fun( ) result(this
)
13 submodule (m1
) ma_submodule
16 module function ma_create_fun() result(this
)
22 !ERROR: 'ma_create_new_fun' was not declared a separate module procedure
23 module function ma_create_new_fun() result(this
)
31 ! case 2: 'mb_create_new_sub' was not declared a separate module procedure
35 module subroutine mb_create_sub
36 end subroutine mb_create_sub
40 submodule (m2
) mb_submodule
43 module subroutine mb_create_sub
47 end subroutine mb_create_sub
49 !ERROR: 'mb_create_new_sub' was not declared a separate module procedure
50 module SUBROUTINE mb_create_new_sub()
54 end SUBROUTINE mb_create_new_sub
57 ! case 3: separate module procedure without module prefix
60 function mc_create( ) result(this
)
66 submodule (m3
) mc_submodule
68 !ERROR: 'mc_create' was not declared a separate module procedure
69 module function mc_create() result(this
)
74 ! case 4: Submodule having separate module procedure rather than a module
77 real module function func1() ! module procedure interface body for func1
84 module function func2(b
) ! module procedure interface body for func2
89 real module function func3() ! module procedure interface body for func3
93 real module function func1() ! implementation of func1 declared in m4
98 submodule (m4
:m4sub
) m4sub2
100 module function func2(b
) ! implementation of func2 declared in m4sub
106 real module function func3() ! implementation of func3 declared in m4sub