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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-options "-O2 -fdump-tree-original" }
3
!
4
! Check the fix for PR31608 in all it's various manifestations:)
5
! Contributed by Richard Guenther 
6
!
7
  character(len=1) :: string = "z"
8
  integer :: i(1) = (/100/)
9
  print *, Up("abc")
10
  print *, transfer(((transfer(string,"x",1))), "x",1)
11
  print *, transfer(char(i), "x")
12
  print *, Upper ("abcdefg")
13
 contains
14
  Character (len=20) Function Up (string)
15
    Character(len=*) string
16
    character(1) :: chr
17
    Up = transfer(achar(iachar(transfer(string,chr,1))), "x")
18
    return
19
  end function Up
20
  Character (len=20) Function Upper (string)
21
    Character(len=*) string
22
    Upper =                                                                &
23
     transfer(merge(transfer(string,"x",len(string)),    &
24
       string, .true.), "x")
25
    return
26
  end function Upper
27
end
28
! The sign that all is well is that [S.6][1] appears twice.
29
! Platform dependent variations are [S$6][1], [__S_6][1], [S___6][1]
30
! { dg-final { scan-tree-dump-times "6\\\]\\\[1\\\]" 2 "original" } }
31
! { dg-final { cleanup-tree-dump "original" } }

powered by: WebSVN 2.1.0

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