1! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror 2! Catch discrepancies between a local interface and a global definition 3 4subroutine global1(x) 5 integer, intent(in) :: x 6end subroutine 7 8subroutine global2(x) bind(c,name="xyz") 9 integer, intent(in) :: x 10end subroutine 11 12subroutine global3(x) 13 integer, intent(in) :: x 14end subroutine 15 16pure subroutine global4(x) 17 integer, intent(in) :: x 18end subroutine 19 20subroutine global5(x) 21 integer, intent(in) :: x 22end subroutine 23 24! Regression check: don't emit bogus "Implicit declaration of function 'global7' has a different result type than in previous declaration" 25recursive function global6() 26 integer global6, z, n 27entry global7(n) result(z) 28 if (n > 0) z = global7(n-1) 29end function 30 31program test 32 interface 33 !WARNING: The global subprogram 'global1' is not compatible with its local procedure declaration (incompatible dummy argument #1: incompatible dummy data object types: INTEGER(4) vs REAL(4)) 34 subroutine global1(x) 35 real, intent(in) :: x 36 end subroutine 37 subroutine global2(x) 38 real, intent(in) :: x 39 end subroutine 40 subroutine global3(x) bind(c,name="abc") 41 real, intent(in) :: x 42 end subroutine 43 subroutine global4(x) ! not PURE, but that's ok 44 integer, intent(in) :: x 45 end subroutine 46 !WARNING: The global subprogram 'global5' is not compatible with its local procedure declaration (incompatible procedure attributes: Pure) 47 pure subroutine global5(x) 48 integer, intent(in) :: x 49 end subroutine 50 function global6() 51 integer global6 52 end function 53 function global7(n) result(z) 54 integer n, z 55 end function 56 end interface 57end 58