diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pr15324.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr15324.f90 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr15324.f90 b/gcc/testsuite/gfortran.dg/pr15324.f90 new file mode 100644 index 000000000..d918717e7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr15324.f90 @@ -0,0 +1,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")) CALL abort() +end subroutine foo +end + +subroutine bar(x,n) + character (len = *), dimension(n) :: x + if (any (x .ne. "BLUBB")) CALL abort() +end subroutine bar |