2 ! { dg-options "-std=f2003" }
5 use, intrinsic :: iso_c_binding, only: c_double
8 common /mycom/ r, s ! { dg-error "In Fortran 2003 COMMON 'mycom' block at .1. is a global identifier and must thus have the same binding name as the same-named COMMON block at .2.: my_common_block vs .blank.|In Fortran 2003 COMMON 'mycom' block at .1. is a global identifier and must thus have the same binding name as the same-named COMMON block at .2.: my_common_block_2 vs .blank." }
11 bind(c, name="my_common_block") :: /mycom/
15 use, intrinsic :: iso_c_binding, only: c_double, c_int
18 common /mycom/ r, s ! { dg-error "In Fortran 2003 COMMON 'mycom' block at .1. is a global identifier and must thus have the same binding name as the same-named COMMON block at .2.: my_common_block vs .blank." }
21 bind(c, name="my_common_block") :: /mycom/
23 common /com2/ i ! { dg-error " In Fortran 2003 COMMON 'com2' block at .1. is a global identifier and must thus have the same binding name as the same-named COMMON block at .2.: mycom2 vs .blank." }
25 bind(c, name="") /com2/
29 use, intrinsic :: iso_c_binding, only: c_double, c_int
32 common /mycom/ r, s ! { dg-error "In Fortran 2003 COMMON 'mycom' block at .1. is a global identifier and must thus have the same binding name as the same-named COMMON block at .2.: my_common_block_2 vs .blank." }
35 ! this next line is an error; if a common block is bind(c), the binding label
36 ! for it must match across all scoping units that declare it.
37 bind(c, name="my_common_block_2") :: /mycom/
39 common /com2/ i ! { dg-error " In Fortran 2003 COMMON 'com2' block at .1. is a global identifier and must thus have the same binding name as the same-named COMMON block at .2.: mycom2 vs .blank." }
41 bind(c, name="mycom2") /com2/