OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [arrayio_12.f90] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! Tests the fix for PR30626, in which the substring reference
3
! for an internal file would cause an ICE.
4
!
5
! Contributed by Francois-Xavier Coudert 
6
 
7
program gfcbug51
8
  implicit none
9
 
10
  character(len=12) :: cdate(3)      ! yyyymmddhhmm
11
 
12
  type year_t
13
    integer :: year = 0
14
  end type year_t
15
 
16
  type(year_t) :: time(3)
17
 
18
  cdate = (/'200612231200', '200712231200', &
19
            '200812231200'/)
20
 
21
  time = date_to_year (cdate)
22
  if (any (time%year .ne. (/2006, 2007, 2008/))) call abort ()
23
 
24
  call month_to_date ((/8, 9, 10/), cdate)
25
  if ( any (cdate .ne. (/'200608231200', '200709231200', &
26
                         '200810231200'/))) call abort ()
27
 
28
contains
29
 
30
  function date_to_year (d) result (y)
31
    character(len=12) :: d(3)
32
    type(year_t) :: y(size (d, 1))
33
    read (cdate(:)(1:4),'(i4)')  time% year
34
  end function date_to_year
35
 
36
  subroutine month_to_date (m, d)
37
    character(len=12) :: d(3)
38
    integer :: m(:)
39
    write (cdate(:)(5:6),'(i2.2)')  m
40
  end subroutine month_to_date
41
 
42
end program gfcbug51

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.