gcc/testsuite/gfortran.dg/binding_label_tests_16.f03
raw| 1 | ! { dg-do run } |
| 2 | ! Verify that the variables 'a' in both modules don't collide. |
| 3 | module m |
| 4 | use iso_c_binding |
| 5 | implicit none |
| 6 | integer(c_int), save, bind(C, name="") :: a = 5 |
| 7 | end module m |
| 8 | |
| 9 | module n |
| 10 | use iso_c_binding |
| 11 | implicit none |
| 12 | integer(c_int), save, bind(C,name="") :: a = -5 |
| 13 | end module n |
| 14 | |
| 15 | program prog |
| 16 | use m |
| 17 | use n, b=>a |
| 18 | implicit none |
| 19 | print *, a, b |
| 20 | if (a /= 5 .or. b /= -5) STOP 1 |
| 21 | end program prog |