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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [char_result_10.f90] - Rev 193

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

! { dg-do compile }
! PR 18883: Fake result variables of non-constant length, with ENTRY
function s_to_c(chars)
    character, pointer :: chars(:)
    character(len=len(chars)) :: s_to_c, s_to_c_2
    s_to_c = 'a'
    return
entry s_to_c_2(chars)
    s_to_c_2 = 'b'
    return
end function s_to_c

program huj

    implicit none
    interface
        function s_to_c(chars)
            character, pointer :: chars(:)
            character(len=len(chars)) :: s_to_c
        end function s_to_c

        function s_to_c_2(chars)
            character, pointer :: chars(:)
            character(len=len(chars)) :: s_to_c_2
        end function s_to_c_2
    end interface

    character, pointer :: c(:)
    character(3) :: s

    allocate(c(5))
    c = (/"a", "b", "c" /)
    s = s_to_c(c)
    s = s_to_c_2(c)

end program huj

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

powered by: WebSVN 2.1.0

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