1! { dg-do compile }
2! { dg-options "-std=f2003" }
3!
4program main
5interface
6  subroutine foo()
7  end
8  integer function bar()
9  end
10end interface
11contains
12  subroutine test()
13  end ! { dg-error "Fortran 2008: END statement instead of END SUBROUTINE" }
14  end subroutine  ! To silence successive errors
15end program
16
17subroutine test2()
18contains
19  integer function f()
20    f = 42
21  end ! { dg-error "Fortran 2008: END statement instead of END FUNCTION" }
22  end function  ! To silence successive errors
23end subroutine test2
24
25