1 ! RUN: %python %S/test_errors.py %s %flang_fc1
3 !ERROR: Array pointer 'x' must have deferred shape or assumed rank
4 real, pointer :: x(1:) ! C832
5 !ERROR: Allocatable array 'y' must have deferred shape or assumed rank
6 real, dimension(1:,1:), allocatable
:: y
! C832
13 !ERROR: Array pointer 'd' must have deferred shape or assumed rank
14 real, pointer :: d(:,1:) ! C832
15 !ERROR: Allocatable array 'e' must have deferred shape or assumed rank
16 real, allocatable
:: e(10,*) ! C832
17 !ERROR: Assumed-rank array 'f' must be a dummy argument
18 real, pointer :: f(..) ! C837
19 !ERROR: Assumed-shape array 'g' must be a dummy argument
21 !ERROR: Assumed-size array 'h' must be a dummy argument
22 real :: h(10,*) ! C833
23 !ERROR: Assumed-rank array 'i' must be a dummy argument
29 !ERROR: Dummy array argument 'b' may not have implied shape
30 real :: b(*,*) ! C835, C836
31 !ERROR: Implied-shape array 'c' must be a named constant or a dummy argument
33 !ERROR: Named constant 'd' array must have constant or implied shape
34 integer, parameter :: d(:) = [1, 2, 3]
39 integer, allocatable
:: a(:)
40 !ERROR: Component array 'b' without ALLOCATABLE or POINTER attribute must have explicit shape
41 integer :: b(:) ! C749
42 real, dimension(1:10) :: c
43 !ERROR: Array pointer component 'd' must have deferred shape
44 real, pointer, dimension(1:10) :: d
! C745
49 !ERROR: Array 'f' without ALLOCATABLE or POINTER attribute must have explicit shape
50 real, dimension(:) :: f
! C832
54 !ERROR: Allocatable array 'a' must have deferred shape or assumed rank
55 integer :: a(10), b(:)
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 named
65 !C843 An entity with the INTENT attribute shall be a dummy data object or a
66 ! dummy procedure pointer.
68 !C849 An entity with the OPTIONAL attribute shall be a dummy argument.
70 !ERROR: Implied-shape array 'local1' must be a named constant or a dummy argument
71 real, dimension (*) :: local1
72 !ERROR: INTENT attributes may apply only to a dummy argument
73 real, intent(in
) :: local2
74 !ERROR: INTENT attributes may apply only to a dummy argument
75 procedure(), intent(in
) :: p1
76 !ERROR: OPTIONAL attribute may apply only to a dummy argument
77 real, optional
:: local3
78 !ERROR: OPTIONAL attribute may apply only to a dummy argument
79 procedure(), optional
:: p2