Debian Codegraph @

gcc/testsuite/gfortran.dg/pr102532.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-fcoarray=single" }
3 !
4 ! Contributed by Gerhard Steinmetz <[email protected]>
5 !
6 subroutine foo
7 character(:), allocatable :: x[:]
8 character(:), dimension(:), allocatable :: c[:]
9 associate (y => x(:)(2:)) ! { dg-error "Unexpected array/substring ref|Invalid association target" }
10 end associate ! { dg-error "Expecting END SUBROUTINE" }
11 associate (a => c(:)(:)(2:)) ! { dg-error "Unexpected array/substring ref|Invalid association target" }
12 end associate ! { dg-error "Expecting END SUBROUTINE" }
13 end
14
15 subroutine bar
16 character(:), allocatable :: x[:]
17 character(:), allocatable :: c
18
19 associate (y => x(:)(:)) ! { dg-error "Unexpected array/substring ref|Invalid association target" }
20 end associate ! { dg-error "Expecting END SUBROUTINE" }
21 c = x(:)(2:5) ! { dg-error "Unexpected array/substring ref" }
22 end