xref: /llvm-project/flang/test/Semantics/resolve07.f90 (revision 6c1ac141d3c98af9738bc77fcb55602cbff7751f)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2subroutine s1
3  integer :: x(2)
4  !ERROR: The dimensions of 'x' have already been declared
5  allocatable :: x(:)
6  real :: y[1:*]
7  !ERROR: The codimensions of 'y' have already been declared
8  allocatable :: y[:]
9end
10
11subroutine s2
12  target :: x(1)
13  !ERROR: The dimensions of 'x' have already been declared
14  integer :: x(2)
15  target :: y[1:*]
16  !ERROR: The codimensions of 'y' have already been declared
17  integer :: y[2:*]
18end
19
20subroutine s3
21  dimension :: x(4), x2(8)
22  !ERROR: The dimensions of 'x' have already been declared
23  allocatable :: x(:)
24  codimension :: y[*], y2[1:2,2:*]
25  !ERROR: The codimensions of 'y' have already been declared
26  allocatable :: y[:]
27end
28
29subroutine s4
30  integer, dimension(10) :: x(2,2), y
31end
32