71 lines · plain
1!RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror2 3!PORTABILITY: An interoperable procedure should have an interface4subroutine subr1(e) bind(c)5 external e6end7 8subroutine subr2(p) bind(c)9 !PORTABILITY: An interoperable procedure should have an interface10 procedure() :: p11end12 13subroutine subr3(p) bind(c)14 !PORTABILITY: An interoperable procedure should have an interface15 procedure(real) :: p16end17 18subroutine subr4(p) bind(c)19 interface20 !PORTABILITY: A dummy procedure of an interoperable procedure should be BIND(C)21 subroutine p(n)22 integer, intent(in) :: n23 end24 end interface25end26 27subroutine subr5(p) bind(c)28 interface29 !WARNING: A dummy procedure of an interoperable procedure should be BIND(C)30 subroutine p(c)31 character(*), intent(in) :: c32 end33 end interface34end35 36subroutine subr6(p) bind(c)37 interface38 function p()39 !ERROR: Interoperable function result must be scalar40 real p(1)41 end42 end interface43end44 45subroutine subr7(p) bind(c)46 interface47 !ERROR: Interoperable character function result must have length one48 character(*) function p()49 end50 end interface51end52 53subroutine subr8(p) bind(c)54 interface55 !WARNING: A dummy procedure of an interoperable procedure should be BIND(C)56 subroutine p(n)57 integer, intent(in), value :: n58 end59 end interface60end61 62subroutine subr9(p) bind(c)63 !ERROR: An interface name with the BIND attribute must appear if the BIND attribute appears in a procedure declaration64 procedure(q), bind(c), pointer :: p65 interface66 function q()67 real q(1)68 end69 end interface70end71