35 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Exercise function vs subroutine distinction in generics3module m14 type t15 integer n6 end type7 interface g18 integer function f1(x, j)9 import t110 class(t1), intent(in out) :: x11 integer, intent(in) :: j12 end13 end interface14end module15 16program test17 use m118 !WARNING: Generic interface 'g1' has both a function and a subroutine [-Wsubroutine-and-function-specifics]19 interface g120 subroutine s1(x, a)21 import t122 class(t1), intent(in out) :: x23 real, intent(in) :: a24 end subroutine25 end interface26 type(t1) :: x27 print *, g1(x,1) ! ok28 !ERROR: No specific function of generic 'g1' matches the actual arguments29 print *, g1(x,1.)30 !ERROR: No specific subroutine of generic 'g1' matches the actual arguments31 call g1(x,1)32 call g1(x, 1.) ! ok33 contains34end35