81 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12subroutine s1(x, y)3 !ERROR: Array pointer 'x' must have deferred shape or assumed rank4 real, pointer :: x(1:) ! C8325 !ERROR: Allocatable array 'y' must have deferred shape or assumed rank6 real, dimension(1:,1:), allocatable :: y ! C8327end8 9subroutine s2(a, b, c)10 real :: a(:,1:)11 real :: b(10,*)12 real :: c(..)13 !ERROR: Array pointer 'd' must have deferred shape or assumed rank14 real, pointer :: d(:,1:) ! C83215 !ERROR: Allocatable array 'e' must have deferred shape or assumed rank16 real, allocatable :: e(10,*) ! C83217 !ERROR: Assumed-rank array 'f' must be a dummy argument18 real, pointer :: f(..) ! C83719 !ERROR: Assumed-shape array 'g' must be a dummy argument20 real :: g(:,1:)21 !ERROR: Assumed-size array 'h' must be a dummy argument22 real :: h(10,*) ! C83323 !ERROR: Assumed-rank array 'i' must be a dummy argument24 real :: i(..) ! C83725end26 27subroutine s3(a, b)28 real :: a(*)29 !ERROR: Dummy array argument 'b' may not have implied shape30 real :: b(*,*) ! C835, C83631 !ERROR: Implied-shape array 'c' must be a named constant or a dummy argument32 real :: c(*) ! C83633 !ERROR: Named constant 'd' array must have constant or implied shape34 integer, parameter :: d(:) = [1, 2, 3]35end36 37subroutine s4()38 type :: t39 integer, allocatable :: a(:)40 !ERROR: Component array 'b' without ALLOCATABLE or POINTER attribute must have explicit shape41 integer :: b(:) ! C74942 real, dimension(1:10) :: c43 !ERROR: Array pointer component 'd' must have deferred shape44 real, pointer, dimension(1:10) :: d ! C74545 end type46end47 48function f()49 !ERROR: Array 'f' without ALLOCATABLE or POINTER attribute must have explicit shape50 real, dimension(:) :: f ! C83251end52 53subroutine s5()54 !ERROR: Allocatable array 'a' must have deferred shape or assumed rank55 integer :: a(10), b(:)56 allocatable :: a57 allocatable :: b58end subroutine59 60subroutine s6()61!C835 An object whose array bounds are specified by an 62! implied-shape-or-assumed-size-spec shall be a dummy data object or a named63! constant.64!65!C843 An entity with the INTENT attribute shall be a dummy data object or a 66! dummy procedure pointer.67!68!C849 An entity with the OPTIONAL attribute shall be a dummy argument.69 70 !ERROR: Implied-shape array 'local1' must be a named constant or a dummy argument71 real, dimension (*) :: local172 !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes]73 real, intent(in) :: local274 !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes]75 procedure(), intent(in) :: p176 !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes]77 real, optional :: local378 !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes]79 procedure(), optional :: p280end subroutine81