1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
4 !ERROR: Array pointer 'x' must have deferred shape or assumed rank
5 real, pointer :: x(1:) ! C832
6 !ERROR: Allocatable array 'y' must have deferred shape or assumed rank
7 real, dimension(1:,1:), allocatable
:: y
! C832
10 subroutine s2(a
, b
, c
)
14 !ERROR: Array pointer 'd' must have deferred shape or assumed rank
15 real, pointer :: d(:,1:) ! C832
16 !ERROR: Allocatable array 'e' must have deferred shape or assumed rank
17 real, allocatable
:: e(10,*) ! C832
18 !ERROR: Assumed-rank array 'f' must be a dummy argument
19 real, pointer :: f(..) ! C837
20 !ERROR: Assumed-shape array 'g' must be a dummy argument
22 !ERROR: Assumed-size array 'h' must be a dummy argument
23 real :: h(10,*) ! C833
24 !ERROR: Assumed-rank array 'i' must be a dummy argument
30 !ERROR: Dummy array argument 'b' may not have implied shape
31 real :: b(*,*) ! C835, C836
32 !ERROR: Implied-shape array 'c' must be a named constant or a dummy argument
34 !ERROR: Named constant 'd' array must have constant or implied shape
35 integer, parameter :: d(:) = [1, 2, 3]
40 integer, allocatable
:: a(:)
41 !ERROR: Component array 'b' without ALLOCATABLE or POINTER attribute must have explicit shape
42 integer :: b(:) ! C749
43 real, dimension(1:10) :: c
44 !ERROR: Array pointer component 'd' must have deferred shape
45 real, pointer, dimension(1:10) :: d
! C745
50 !ERROR: Array 'f' without ALLOCATABLE or POINTER attribute must have explicit shape
51 real, dimension(:) :: f
! C832
55 !ERROR: Allocatable array 'a' must have deferred shape or assumed rank
56 integer :: a(10), b(:)
62 !C835 An object whose array bounds are specified by an
63 ! implied-shape-or-assumed-size-spec shall be a dummy data object or a named
66 !C843 An entity with the INTENT attribute shall be a dummy data object or a
67 ! dummy procedure pointer.
69 !C849 An entity with the OPTIONAL attribute shall be a dummy argument.
71 !ERROR: Implied-shape array 'local1' must be a named constant or a dummy argument
72 real, dimension (*) :: local1
73 !ERROR: INTENT attributes may apply only to a dummy argument
74 real, intent(in
) :: local2
75 !ERROR: INTENT attributes may apply only to a dummy argument
76 procedure(), intent(in
) :: p1
77 !ERROR: OPTIONAL attribute may apply only to a dummy argument
78 real, optional
:: local3
79 !ERROR: OPTIONAL attribute may apply only to a dummy argument
80 procedure(), optional
:: p2