1! { dg-do compile }
2module A
3  use, intrinsic :: iso_c_binding
4contains
5  subroutine pA() bind(c, name='printf') ! { dg-error "Procedure 'pb' with binding label 'printf' at .1. uses the same global identifier as entity at .2." }
6    print *, 'hello from pA'
7  end subroutine pA
8end module A
9
10module B
11  use, intrinsic :: iso_c_binding
12
13contains
14  subroutine pB() bind(c, name='printf') ! { dg-error "Procedure 'pb' with binding label 'printf' at .1. uses the same global identifier as entity at .2." }
15    print *, 'hello from pB'
16  end subroutine pB
17end module B
18
19module C
20use A
21use B ! { dg-error "Cannot open module file" }
22end module C
23! { dg-excess-errors "compilation terminated" }
24