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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! Tests the fix for PR33998, in which the chain of expressions
3
! determining the character length of my_string were not being
4
! resolved by the formal to actual mapping.
5
!
6
! Contributed by Tobias Burnus 
7
!
8
module test
9
   implicit none
10
   contains
11
      function my_string(x)
12
         integer i
13
         real, intent(in) :: x(:)
14
         character(0) h4(1:minval([(i,i=30,32), 15]))
15
         character(0) sv1(size(x,1):size(h4))
16
         character(0) sv2(2*lbound(sv1,1):size(h4))
17
         character(lbound(sv2,1)-3) my_string
18
 
19
         do i = 1, len(my_string)
20
            my_string(i:i) = achar(modulo(i-1,10)+iachar('0'))
21
         end do
22
      end function my_string
23
end module test
24
 
25
program len_test
26
   use test
27
   implicit none
28
   real x(7)
29
 
30
   if (my_string(x) .ne. "01234567890") call abort ()
31
end program len_test
32
! { dg-final { cleanup-modules "test" } }

powered by: WebSVN 2.1.0

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