re PR fortran/44735 (ICE on FORALL with character array pointer)
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Mon, 4 May 2015 14:27:14 +0000 (14:27 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Mon, 4 May 2015 14:27:14 +0000 (14:27 +0000)
PR fortran/44735
* gfortran.dg/pr44735.f90: New test.

From-SVN: r222766

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

index 58308186822f8a05b63e6508d5e1ff29fa4151f2..cb7bc61bb1228f791b22cbf47c1351fce304b06c 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/44735
+       * gfortran.dg/pr44735.f90: New test.
+
 2015-05-04  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/65965
diff --git a/gcc/testsuite/gfortran.dg/pr44735.f90 b/gcc/testsuite/gfortran.dg/pr44735.f90
new file mode 100644 (file)
index 0000000..0c9b8de
--- /dev/null
@@ -0,0 +1,16 @@
+! { dg-do run }
+
+program main
+  if (bug() /= "abcdefghij") call abort
+contains
+  function bug()
+    character(len=10) :: bug
+    character(len=1), dimension(:), pointer :: p_chars
+    allocate(p_chars(10))
+    p_chars = ['a','b','c','d','e','f','g','h','i','j']
+    forall (i=1:len(bug))
+      bug(i:i) = p_chars(i)
+    end forall
+    deallocate(p_chars)
+  end function bug
+end program main