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_11.f90] - Blame information for rev 853

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 PR30284, in which the substring plus
3
! component reference for an internal file would cause an ICE.
4
!
5
! Contributed by Harald Anlauf 
6
 
7
program gfcbug51
8
  implicit none
9
 
10
  type :: date_t
11
    character(len=12) :: date      ! yyyymmddhhmm
12
  end type date_t
13
 
14
  type year_t
15
    integer :: year = 0
16
  end type year_t
17
 
18
  type(date_t) :: file(3)
19
  type(year_t) :: time(3)
20
 
21
  FILE%date = (/'200612231200', '200712231200', &
22
                '200812231200'/)
23
 
24
  time = date_to_year (FILE)
25
  if (any (time%year .ne. (/2006, 2007, 2008/))) call abort ()
26
 
27
  call month_to_date ((/8, 9, 10/), FILE)
28
  if ( any (file%date .ne. (/'200608231200', '200709231200', &
29
                             '200810231200'/))) call abort ()
30
 
31
contains
32
 
33
  function date_to_year (d) result (y)
34
    type(date_t) :: d(3)
35
    type(year_t) :: y(size (d, 1))
36
    read (d%date(1:4),'(i4)')  time% year
37
  end function date_to_year
38
 
39
  subroutine month_to_date (m, d)
40
    type(date_t) :: d(3)
41
    integer :: m(:)
42
    write (d%date(5:6),'(i2.2)')  m
43
  end subroutine month_to_date
44
 
45
end program gfcbug51

powered by: WebSVN 2.1.0

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