URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [char_result_4.f90] - Rev 694
Compare with Previous | Blame | View Log
! Like char_result_3.f90, but the array arguments are pointers.! { dg-do run }pure elemental function double (x)integer, intent (in) :: xinteger :: doubledouble = x * 2end function doubleprogram mainimplicit noneinterfacepure elemental function double (x)integer, intent (in) :: xinteger :: doubleend function doubleend interfaceinteger, dimension (100:104), target :: ainteger, dimension (:), pointer :: apinteger :: i, lowera = (/ (i + 5, i = 0, 4) /)ap => alower = lbound(a,dim=1)call test (f1 (ap), 35)call test (f2 (ap), 115)call test (f3 (ap), 60)call test (f4 (ap, 104, 2), 21)containsfunction f1 (array)integer, dimension (:), pointer :: arraycharacter (len = sum (array)) :: f1f1 = ''end function f1function f2 (array)integer, dimension (:), pointer :: arraycharacter (len = array (101) + a (104) + 100) :: f2f2 = ''end function f2function f3 (array)integer, dimension (:), pointer :: arraycharacter (len = sum (double (array (101:)))) :: f3f3 = ''end function f3function f4 (array, upper, stride)integer, dimension (:), pointer :: arrayinteger :: upper, stridecharacter (len = sum (array (lower:upper:stride))) :: f4f4 = ''end function f4subroutine test (string, length)character (len = *) :: stringinteger, intent (in) :: lengthif (len (string) .ne. length) call abortend subroutine testend program main
