| 1 |
! { dg-do compile } |
| 2 |
module A |
| 3 |
use, intrinsic :: iso_c_binding |
| 4 |
contains |
| 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 |
| 8 |
end module A |
| 9 |
|
| 10 |
module B |
| 11 |
use, intrinsic :: iso_c_binding |
| 12 |
|
| 13 |
contains |
| 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 |
| 17 |
end module B |
| 18 |
|
| 19 |
module C |
| 20 |
use A |
| 21 |
use B ! { dg-error "Cannot open module file" } |
| 22 |
end module C |
| 23 |
! { dg-prune-output "compilation terminated" } |