* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / gfortran.dg / arrayio_12.f90
blob09fa6c8a15e92e2b99e6ff9f6df6b49b4f865d81
1 ! { dg-do run }
2 ! Tests the fix for PR30626, in which the substring reference
3 ! for an internal file would cause an ICE.
5 ! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
7 program gfcbug51
8 implicit none
10 character(len=12) :: cdate(3) ! yyyymmddhhmm
12 type year_t
13 integer :: year = 0
14 end type year_t
16 type(year_t) :: time(3)
18 cdate = (/'200612231200', '200712231200', &
19 '200812231200'/)
21 call date_to_year (cdate)
22 if (any (time%year .ne. (/2006, 2007, 2008/))) call abort ()
24 call month_to_date ((/8, 9, 10/), cdate)
25 if ( any (cdate .ne. (/'200608231200', '200709231200', &
26 '200810231200'/))) call abort ()
28 contains
30 subroutine date_to_year (d)
31 character(len=12) :: d(3)
32 read (cdate(:)(1:4),'(i4)') time%year
33 end subroutine
35 subroutine month_to_date (m, d)
36 character(len=12) :: d(3)
37 integer :: m(:)
38 write (cdate(:)(5:6),'(i2.2)') m
39 end subroutine month_to_date
41 end program gfcbug51