83 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! test bind(c) name conflict3 4module m5 6 integer :: x, y, z, w, i, j, k7 8 !ERROR: Two entities have the same global name 'aa'9 common /blk1/ x, /blk2/ y10 bind(c, name="aa") :: /blk1/, /blk2/11 12 integer :: t13 !ERROR: Two entities have the same global name 'bb'14 common /blk3/ z15 bind(c, name="bb") :: /blk3/, t16 17 integer :: t218 !ERROR: Two entities have the same global name 'cc'19 common /blk4/ w20 bind(c, name="cc") :: t2, /blk4/21 22 !ERROR: The entity 'blk5' has multiple BIND names ('dd' and 'ee')23 common /blk5/ i24 bind(c, name="dd") :: /blk5/25 bind(c, name="ee") :: /blk5/26 27 !ERROR: Two entities have the same global name 'ff'28 common /blk6/ j, /blk7/ k29 bind(c, name="ff") :: /blk6/30 bind(c, name="ff") :: /blk7/31 32 !ERROR: The entity 's1' has multiple BIND names ('gg' and 'hh')33 integer :: s134 bind(c, name="gg") :: s135 !ERROR: BIND_C attribute was already specified on 's1'36 bind(c, name="hh") :: s137 38 !ERROR: Two entities have the same global name 'ii'39 integer :: s2, s340 bind(c, name="ii") :: s241 bind(c, name="ii") :: s342 43 !ERROR: The entity 's4' has multiple BIND names ('ss1' and 'jj')44 integer, bind(c, name="ss1") :: s445 !ERROR: BIND_C attribute was already specified on 's4'46 bind(c, name="jj") :: s447 48 !ERROR: The entity 's5' has multiple BIND names ('kk' and 'ss2')49 bind(c, name="kk") :: s550 !ERROR: BIND_C attribute was already specified on 's5'51 integer, bind(c, name="ss2") :: s552 53 integer, bind(c, name="s6explicit") :: s654 dimension s6(10) ! caused spurious error55 56end57 58subroutine common1()59 real :: x60 common /com/ x61 bind(c, name='xcom') /com/ ! no error62end subroutine63 64subroutine common2()65 real :: x66 common /com/ x67 bind(c, name='xcom') /com/ ! no error68end subroutine69 70module a71 integer, bind(c, name="int") :: i72end module73 74module b75 !ERROR: Two entities have the same global name 'int'76 integer, bind(c, name="int") :: i77end module78 79module c80 bind(c, name = "AAA") a81 integer aaa ! ensure no bogus error about multiple binding names82end module83