diff gcc/testsuite/gfortran.dg/implied_do_io_4.f90 @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gfortran.dg/implied_do_io_4.f90	Thu Oct 25 10:21:07 2018 +0900
@@ -0,0 +1,22 @@
+! { dg-do  run }
+! { dg-additional-options "-ffrontend-optimize -fdump-tree-original" }
+! PR fortran/35339  - make sure that I/O of an implied DO loop
+! of allocatable character arrays a) works and b) is converted
+! to a transfer_array
+program main
+    implicit none
+    integer:: i
+    integer, parameter:: N = 10
+    character(len=:), dimension(:),allocatable:: ca
+    allocate(character(len=N):: ca(3))
+    open(unit=10,status="scratch")
+    ca(1) = "foo"
+    ca(2) = "bar"
+    ca(3) = "xyzzy"
+    write (10, '(3A10)') (ca(i),i=1,3)
+    rewind (10)
+    ca(:) = ''
+    read (10, '(3A10)') (ca(i),i=1,3)
+    if (ca(1) /= 'foo' .or. ca(2) /= 'bar' .or. ca(3) /= 'xyzzy') call abort
+end program
+! { dg-final { scan-tree-dump-times "_gfortran_transfer_array" 2 "original" } }