re PR fortran/15324 (segfault / ICE with array of assumed length characters)
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Thu, 15 Jul 2004 14:59:15 +0000 (16:59 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Thu, 15 Jul 2004 14:59:15 +0000 (16:59 +0200)
PR fortran/15324
* gfortran.dg/pr15324.f90: New test.

From-SVN: r84754

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr15324.f90 [new file with mode: 0644]

index 5d763cc2f273c1da3613ad50e77fe73a09d3a406..69cd43e3afc654be1f168c70b4b89197c2c733cb 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-15  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/15324
+       * gfortran.dg/pr15324.f90: New test.
+
 2004-07-14  Mike Stump  <mrs@apple.com>
 
        * gcc.dg/20020426-2.c: Improve type safety wrt unsignedness.
diff --git a/gcc/testsuite/gfortran.dg/pr15324.f90 b/gcc/testsuite/gfortran.dg/pr15324.f90
new file mode 100644 (file)
index 0000000..ce53463
--- /dev/null
@@ -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-1))
+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