aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr15324.f90
blob: dee027ebc3996cb2eb5592d6811a6dd72e5074c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do run }
! PR 15234
! tests for passing arrays of assumed length characters
program strarray_6
character(5), dimension(:), allocatable :: c
n = 3
allocate(c(-1:n-2))
c = "BLUBB"
call foo(c)
call bar(c,n)
deallocate(c)
contains
subroutine foo(x)
  character (len = *), dimension(:) :: x
  if (any (x .ne. "BLUBB")) STOP 1
end subroutine foo
end

subroutine bar(x,n)
  character (len = *), dimension(n) :: x
  if (any (x .ne. "BLUBB")) STOP 2
end subroutine bar