gcc/testsuite/gfortran.dg/interface_47.f90
raw| 1 | ! PR fortran/27318 |
| 2 | ! { dg-do compile } |
| 3 | ! This tests for mismatch between the interface for a global |
| 4 | ! procedure and the procedure itself. |
| 5 | |
| 6 | module test |
| 7 | implicit none |
| 8 | interface |
| 9 | subroutine hello(n) ! { dg-warning "INTENT mismatch" } |
| 10 | integer :: n |
| 11 | end subroutine hello |
| 12 | end interface |
| 13 | end module test |
| 14 | |
| 15 | subroutine hello(n) ! { dg-warning "INTENT mismatch" } |
| 16 | integer, intent(in) :: n |
| 17 | integer :: i |
| 18 | do i = 1,n; print *, 'hello'; end do |
| 19 | end subroutine hello |