brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 66e1f0b Raw
51 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2! Check for 8.6.4(1)3! The BIND statement specifies the BIND attribute for a list of variables and4! common blocks.5 6module m7 8  interface9    subroutine proc()10    end11  end interface12  procedure(proc) :: pc113  !ERROR: Only variable and named common block can be in BIND statement14  bind(c) :: proc15  !ERROR: Only variable and named common block can be in BIND statement16  bind(c) :: pc117 18  !ERROR: BIND_C attribute was already specified on 'sub'19  !ERROR: Only variable and named common block can be in BIND statement20  bind(c) :: sub21 22  !PORTABILITY: Global name 'm' conflicts with a module [-Wbenign-name-clash]23  !PORTABILITY: Name 'm' declared in a module should not have the same name as the module [-Wbenign-name-clash]24  bind(c) :: m ! no error for implicit type variable25 26  type my_type27    integer :: i28  end type29  !ERROR: Only variable and named common block can be in BIND statement30  bind(c) :: my_type31 32  enum, bind(c) ! no error33    enumerator :: SUNDAY, MONDAY34  end enum35 36  integer :: x, y, z = 137  common /blk/ y38  bind(c) :: x, /blk/, z ! no error for variable and common block39 40  bind(c) :: implicit_i ! no error for implicit type variable41 42  !ERROR: 'implicit_blk' appears as a COMMON block in a BIND statement but not in a COMMON statement43  bind(c) :: /implicit_blk/44 45contains46 47  subroutine sub() bind(c)48  end49 50end51