133 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12subroutine s13 !ERROR: Array 'x' without ALLOCATABLE or POINTER attribute must have explicit shape4 common x(:), y(4), z5end6 7subroutine s28 common /c1/ x, y, z9 !ERROR: 'y' is already in a COMMON block10 common y11end12 13subroutine s314 !ERROR: 'x' may not be a procedure as it is in a COMMON block15 procedure(real) :: x16 common x17 common y18 !ERROR: 'y' may not be a procedure as it is in a COMMON block19 procedure(real) :: y20end21 22subroutine s523 integer x(2)24 !ERROR: The dimensions of 'x' have already been declared25 common x(4), y(4)26 !ERROR: The dimensions of 'y' have already been declared27 real y(2)28end29 30function f6(x) result(r)31 !ERROR: ALLOCATABLE object 'y' may not appear in COMMON block //32 !ERROR: Dummy argument 'x' may not appear in COMMON block //33 !ERROR: Function result 'r' may not appear in COMMON block //34 common y,x,z35 allocatable y36 common r37end38 39module m740 !ERROR: BIND(C) object 'w' may not appear in COMMON block //41 !ERROR: BIND(C) object 'z' may not appear in COMMON block //42 common w,z43 integer, bind(c) :: z44 integer, bind(c,name="w") :: w45end46 47module m848 type t49 end type50 class(*), pointer :: x51 !ERROR: Unlimited polymorphic pointer 'x' may not appear in COMMON block //52 !ERROR: Unlimited polymorphic pointer 'y' may not appear in COMMON block //53 common x, y54 class(*), pointer :: y55end56 57module m958 integer x59end60subroutine s961 use m962 !ERROR: 'x' is use-associated from module 'm9' and cannot be re-declared63 common x64end65 66module m1067 type t68 end type69 type(t) :: x70 !ERROR: Object 'x' whose derived type 't' is neither SEQUENCE nor BIND(C) may not appear in COMMON block //71 common x72end73 74module m1175 type t176 sequence77 integer, allocatable :: a78 end type79 type t280 sequence81 type(t1) :: b82 integer:: c83 end type84 type(t2) :: x285 !ERROR: COMMON block /c2/ may not have the member 'x2' whose derived type 't2' has a component '%b%a' that is ALLOCATABLE or has default initialization86 common /c2/ x287end88 89module m1290 type t191 sequence92 integer :: a = 12393 end type94 type t295 sequence96 type(t1) :: b97 integer:: c98 end type99 type(t2) :: x2100 !ERROR: COMMON block /c3/ may not have the member 'x2' whose derived type 't2' has a component '%b%a' that is ALLOCATABLE or has default initialization101 common /c3/ x2102end103 104subroutine s13105 block106 !ERROR: COMMON statement is not allowed in a BLOCK construct107 common x108 end block109end110 111subroutine s14112 !ERROR: 'c' appears as a COMMON block in a BIND statement but not in a COMMON statement113 bind(c) :: /c/114end115 116module m15117 interface118 subroutine sub119 end subroutine120 end interface121 type t1122 sequence123 procedure(sub), pointer, nopass :: pp => sub124 end type125 type t2126 sequence127 type(t1) :: a128 end type129 type(t2) :: x2130 !ERROR: COMMON block /c4/ may not have the member 'x2' whose derived type 't2' has a component '%a%pp' that is ALLOCATABLE or has default initialization131 common /c4/ x2132end133