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_9.f90] - Rev 149

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

! { dg-do compile }
! PR 18883: Fake result variables of non-constant length, in module
module foo
contains
    function s_to_c(chars)
        character, pointer :: chars(:)
        character(len=len(chars)) :: s_to_c
        s_to_c = 'a'
    end function s_to_c
end module foo

program huj

    use foo

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

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

end program huj

! { dg-final { cleanup-modules "foo" } }

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.