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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [char_result_12.f90] - Rev 154

Compare with Previous | Blame | View Log

! { dg-final { cleanup-modules "gfcbug45" } }
! { dg-do run }
! Tests the fix for PR29912, in which the call to JETTER
! would cause a segfault beause a temporary was not being written.
!
! COntributed by Philip Mason  <pmason@ricardo.com>
!
 program testat
 character(len=4)   :: ctemp(2)
 character(len=512) :: temper(2)
 !
 !------------------------
 !'This was OK.'
 !------------------------
 temper(1) = 'doncaster'
 temper(2) = 'uxbridge'
 ctemp     = temper
 if (any (ctemp /= ["donc", "uxbr"])) call abort ()
 !
 !------------------------
 !'This went a bit wrong.'
 !------------------------
 ctemp = jetter(1,2)
 if (any (ctemp /= ["donc", "uxbr"])) call abort ()

 contains
   function jetter(id1,id2)
   character(len=512) :: jetter(id1:id2)
   jetter(id1) = 'doncaster'
   jetter(id2) = 'uxbridge'
   end function jetter
 end program testat

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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