summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/array_constructor_18.f90
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-18 08:34:42 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-18 08:34:42 +0000
commit34989da61c0b389079a834f8c599015c869ba428 (patch)
treeb72ad2f3086f63d2bd98f124757c97fdf7373a63 /gcc/testsuite/gfortran.dg/array_constructor_18.f90
parentb976cd16eac44a5059667263340266473b3c071d (diff)
downloadgcc-34989da61c0b389079a834f8c599015c869ba428.tar.gz
2007-08-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32875 * trans-array.c (get_array_ctor_strlen): Set the character length of a zero length array to zero. 2007-08-18 Paul Thomas <pault@gcc.gnu.org> PR fortran/32875 * gfortran.dg/array_constructor_18.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127608 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/array_constructor_18.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_18.f9019
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_18.f90 b/gcc/testsuite/gfortran.dg/array_constructor_18.f90
new file mode 100644
index 00000000000..246f448063c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_constructor_18.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! Tests the fix for PR32875, in which the character length for the
+! array constructor would get lost in simplification and would lead
+! the error 'Not Implemented: complex character array constructor'.
+!
+! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
+!
+ call foo ((/(S1(i),i=1,3,-1)/))
+CONTAINS
+ FUNCTION S1(i)
+ CHARACTER(LEN=1) :: S1
+ INTEGER :: I
+ S1="123456789"(i:i)
+ END FUNCTION S1
+ subroutine foo (chr)
+ character(1) :: chr(:)
+ print *, chr
+ end subroutine
+END