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

Subversion Repositories openrisc_me

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

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

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do "run" }
2
! PR fortran/36795
3
! "(str)" (= an expression) was regarded as "str" (= a variable)
4
! and thus when yy was deallocated so was xx. Result: An invalid
5
! memory access.
6
!
7
program main
8
  implicit none
9
  character (len=10), allocatable :: str(:)
10
  allocate (str(1))
11
  str(1)      = "dog"
12
  if (size(str) /= 1 .or. str(1) /= "dog") call abort()
13
contains
14
  subroutine foo(xx,yy)
15
    character (len=*), intent(in)               :: xx(:)
16
    character (len=*), intent(out), allocatable :: yy(:)
17
    allocate (yy(size(xx)))
18
    yy = xx
19
  end subroutine foo
20
end program main

powered by: WebSVN 2.1.0

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