65 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12subroutine test13 !WARNING: Generic interface 'foo' has both a function and a subroutine [-Wsubroutine-and-function-specifics]4 interface foo5 subroutine s1(x)6 end subroutine7 subroutine s2(x, y)8 end subroutine9 function f()10 end function11 end interface12end subroutine13 14subroutine test215 !WARNING: Generic interface 'foo' has both a function and a subroutine [-Wsubroutine-and-function-specifics]16 interface foo17 function t2f1(x)18 end function19 subroutine s()20 end subroutine21 function t2f2(x, y)22 end function23 end interface24end subroutine25 26module test327 !WARNING: Generic interface 'foo' has both a function and a subroutine [-Wsubroutine-and-function-specifics]28 interface foo29 module procedure s30 module procedure f31 end interface32contains33 subroutine s(x)34 end subroutine35 function f()36 end function37end module38 39subroutine test440 type foo41 end type42 !WARNING: Generic interface 'foo' should only contain functions due to derived type with same name [-Wsubroutine-and-function-specifics]43 interface foo44 subroutine s()45 end subroutine46 end interface47end subroutine48 49subroutine test550 interface foo51 function t5f1()52 end function53 end interface54 interface bar55 subroutine t5s1()56 end subroutine57 subroutine t5s2(x)58 end subroutine59 end interface60 !ERROR: Cannot call function 'foo' like a subroutine61 call foo()62 !ERROR: Cannot call subroutine 'bar' like a function63 x = bar()64end subroutine65