PR target/83368
[official-gcc.git] / gcc / testsuite / gfortran.dg / binding_label_tests_4.f03
blob7214289c976847ed6f8b3fa46dbe78819b9b7483
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
10 module B
11   use, intrinsic :: iso_c_binding
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
19 module C
20 use A
21 use B ! { dg-error "Can't open module file" }
22 end module C
23 ! { dg-excess-errors "compilation terminated" }