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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-fbackslash" }
3
 
4
module kinds
5
  implicit none
6
  integer, parameter :: one = 1, four = 4
7
end module kinds
8
 
9
module inner
10
  use kinds
11
  implicit none
12
  character(kind=one,len=*), parameter :: inner1 = "abcdefg \xEF kl"
13
  character(kind=four,len=*), parameter :: &
14
        inner4 = 4_"\u9317x \U001298cef   dea\u10De"
15
end module inner
16
 
17
module middle
18
  use inner
19
  implicit none
20
  character(kind=one,len=len(inner1)), dimension(2,2), parameter :: middle1 &
21
    = reshape ([ character(kind=one,len=len(inner1)) :: inner1, ""], &
22
               [ 2, 2 ], &
23
               [ character(kind=one,len=len(inner1)) :: "foo", "ba " ])
24
  character(kind=four,len=len(inner4)), dimension(2,2), parameter :: middle4 &
25
    = reshape ([ character(kind=four,len=len(inner4)) :: inner4, 4_""], &
26
               [ 2, 2 ], &
27
               [ character(kind=four,len=len(inner4)) :: 4_"foo", 4_"ba " ])
28
end module middle
29
 
30
module outer
31
  use middle
32
  implicit none
33
  character(kind=one,len=*), parameter :: my1(2) = middle1(1,:)
34
  character(kind=four,len=*), parameter :: my4(2) = middle4(1,:)
35
end module outer
36
 
37
program test_modules
38
  use outer, outer1 => my1, outer4 => my4
39
  implicit none
40
 
41
  if (len (inner1) /= len(inner4)) call abort
42
  if (len (inner1) /= len_trim(inner1)) call abort
43
  if (len (inner4) /= len_trim(inner4)) call abort
44
 
45
  if (len(middle1) /= len(inner1)) call abort
46
  if (len(outer1) /= len(inner1)) call abort
47
  if (len(middle4) /= len(inner4)) call abort
48
  if (len(outer4) /= len(inner4)) call abort
49
 
50
  if (any (len_trim (middle1) /= reshape([len(middle1), 0, 3, 2], [2,2]))) &
51
    call abort
52
  if (any (len_trim (middle4) /= reshape([len(middle4), 0, 3, 2], [2,2]))) &
53
    call abort
54
  if (any (len_trim (outer1) /= [len(outer1), 3])) call abort
55
  if (any (len_trim (outer4) /= [len(outer4), 3])) call abort
56
 
57
end program test_modules
58
 
59
! { dg-final { cleanup-modules "kinds inner middle outer" } }

powered by: WebSVN 2.1.0

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