1! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
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