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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
!
3
! Check the fix for PR34955 in which three bytes would be copied
4
! from bytes by TRANSFER, instead of the required two and the
5
! resulting string length would be incorrect.
6
!
7
! Contributed by Dominique Dhumieres  
8
!
9
  character(len = 1)  :: string = "z"
10
  character(len = 20) :: tmp = ""
11
  tmp = Upper ("abcdefgh")
12
  if (trim(tmp) .ne. "ab") call abort ()
13
contains
14
  Character (len = 20) Function Upper (string)
15
    Character(len = *) string
16
    integer :: ij
17
    i = size (transfer (string,"xy",len (string)))
18
    if (i /= len (string)) call abort ()
19
    Upper = ""
20
    Upper(1:2) = &
21
    transfer (merge (transfer (string,"xy",len (string)),    &
22
      string(1:2), .true.), "xy")
23
    return
24
  end function Upper
25
end

powered by: WebSVN 2.1.0

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