2018-09-30 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr15324.f90
blobdee027ebc3996cb2eb5592d6811a6dd72e5074c0
1 ! { dg-do run }
2 ! PR 15234
3 ! tests for passing arrays of assumed length characters
4 program strarray_6
5 character(5), dimension(:), allocatable :: c
6 n = 3
7 allocate(c(-1:n-2))
8 c = "BLUBB"
9 call foo(c)
10 call bar(c,n)
11 deallocate(c)
12 contains
13 subroutine foo(x)
14 character (len = *), dimension(:) :: x
15 if (any (x .ne. "BLUBB")) STOP 1
16 end subroutine foo
17 end
19 subroutine bar(x,n)
20 character (len = *), dimension(n) :: x
21 if (any (x .ne. "BLUBB")) STOP 2
22 end subroutine bar