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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [pr17612.f90] - Blame information for rev 720

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR 17612
3
! We used to not determine the length of character-valued expressions
4
! correctly, leading to a segfault.
5
program prog
6
  character(len=2), target :: c(4)
7
  type pseudo_upf
8
     character(len=2), pointer :: els(:)
9
  end type pseudo_upf
10
  type (pseudo_upf) :: p
11
  type t
12
    character(5) :: s(2)
13
  end type
14
  type (t) v
15
  ! A full arrays.
16
  c = (/"ab","cd","ef","gh"/)
17
  call n(p)
18
  if (any (c /= p%els)) call abort
19
  ! An array section that needs a new array descriptor.
20
  v%s(1) = "hello"
21
  v%s(2) = "world"
22
  call test (v%s)
23
contains
24
 
25
  subroutine n (upf)
26
    type (pseudo_upf), intent(inout) :: upf
27
    upf%els => c
28
    return
29
  end subroutine n
30
 
31
  subroutine test(s)
32
    character(len=*) :: s(:)
33
    if ((len (s) .ne. 5) .or. (any (s .ne. (/"hello", "world"/)))) call abort
34
  end subroutine
35
end program
36
 
37
 

powered by: WebSVN 2.1.0

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