Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / bind-c01.f90
blobf0546b3eb068ca89b1c2040ca13cd3d94ec1f548
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for multiple symbols being defined with with same BIND(C) name
4 module m1
5 integer, bind(c, name="x1") :: x1
6 !ERROR: Two entities have the same global name 'x1'
7 integer, bind(c, name=" x1 ") :: x2
8 contains
9 subroutine x3() bind(c, name="x3")
10 end subroutine
11 end module
13 !ERROR: Two entities have the same global name 'x3'
14 subroutine x4() bind(c, name=" x3 ")
15 end subroutine
17 ! Ensure no error in this situation
18 module m2
19 interface
20 subroutine x5() bind(c, name=" x5 ")
21 end subroutine
22 end interface
23 end module
24 subroutine x5() bind(c, name=" x5 ")
25 end subroutine
27 ! Ensure no error in this situation
28 subroutine foo() bind(c, name="x6")
29 end subroutine
30 subroutine foo() bind(c, name="x7")
31 end subroutine