OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [elemental_initializer_1.f90] - Blame information for rev 302

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
! Tests the fix for elemental functions not being allowed in
3
! specification expressions in pure procedures.
4
!
5
! Testcase from iso_varying_string by Rich Townsend 
6
! The allocatable component has been changed to a pointer for this testcase.
7
!
8
module iso_varying_string
9
 
10
  type varying_string
11
     private
12
     character(LEN=1), dimension(:), pointer :: chars
13
  end type varying_string
14
 
15
  interface len
16
     module procedure len_
17
  end interface len
18
 
19
contains
20
 
21
  pure function char_auto (string) result (char_string)
22
    type(varying_string), intent(in) :: string
23
    character(LEN=len(string))       :: char_string ! Error was here
24
    char_string = ""
25
  end function char_auto
26
 
27
  elemental function len_ (string) result (length)
28
    type(varying_string), intent(in) :: string
29
    integer                          :: length
30
    length = 1
31
  end function len_
32
 
33
end module iso_varying_string
34
 
35
! { dg-final { cleanup-modules "iso_varying_string" } }

powered by: WebSVN 2.1.0

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