libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / write_zero_array.f90
blobda7afc1426cd4b63f92f702c37a207836b272702
1 ! { dg-do run }
2 ! PR30145 write statement fails to ignore zero-sized array
3 ! Test case from PR, submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
4 program zeros
5 implicit none
6 character(20) :: msg = ""
7 integer :: itemp(10) = 0
8 integer :: ics
9 !This was OK
10 write(msg,*) 'itemp(6:0) = ',itemp(6:0),'a'
11 if (msg /= " itemp(6:0) = a") call abort()
12 !This did not work before patch, segfaulted
13 ics=6
14 write(msg,*) 'itemp(ics:0) = ',itemp(ics:0),'a'
15 if (msg /= " itemp(ics:0) = a") call abort()
16 end program zeros