1! { dg-do compile }
2!
3! PR fortran/51605
4!
5
6contains
7  subroutine foo
8    BLOCK_NAME: block
9    end block BLOCK_NAME
10  end subroutine foo
11
12  subroutine BLOCK_NAME()
13  end subroutine BLOCK_NAME
14
15  subroutine bar()
16  end subroutine bar
17end
18
19subroutine test()
20contains
21  subroutine BLOCK_NAME()
22  end subroutine BLOCK_NAME
23
24  subroutine foobar()
25  end subroutine foobar
26
27  subroutine foo
28    BLOCK_NAME: block
29    end block BLOCK_NAME
30  end subroutine foo
31
32  subroutine bar()
33  end subroutine bar
34end
35