2015-07-03 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr15324.f90
blobd918717e7482d4ac03ca6bfac9b01df9f440d6cd
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")) CALL abort()
16 end subroutine foo
17 end
19 subroutine bar(x,n)
20 character (len = *), dimension(n) :: x
21 if (any (x .ne. "BLUBB")) CALL abort()
22 end subroutine bar