view gcc/testsuite/gfortran.dg/string_4.f90 @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! { dg-do compile }
! { dg-options "" }
! (options to disable warnings about statement functions etc.)
!
! PR fortran/44352
!
! Contributed by Vittorio Zecca
!

      SUBROUTINE TEST1()
      implicit real*8 (a-h,o-z)
      character*32 ddname,stmtfnt1
      stmtfnt1(x)=   'h810 e=0.01         '
      ddname=stmtfnt1(0.d0)
      if (ddname /= "h810 e=0.01") call abort()
      END

      SUBROUTINE TEST2()
      implicit none
      character(2)  :: ddname,stmtfnt2
      real :: x
      stmtfnt2(x)=   'x'
      ddname=stmtfnt2(0.0)
      if(ddname /= 'x') call abort()
      END

      SUBROUTINE TEST3()
      implicit real*8 (a-h,o-z)
      character*32 ddname,dname
      character*2 :: c
      dname(c) = 'h810 e=0.01         '
      ddname=dname("w ")
      if (ddname /= "h810 e=0.01") call abort()
      END

      SUBROUTINE TEST4()
      implicit real*8 (a-h,o-z)
      character*32 ddname,dname
      character*2 :: c
      dname(c) = 'h810 e=0.01         '
      c = 'aa'
      ddname=dname("w ")
      if (ddname /= "h810 e=0.01") call abort()
      if (c /= "aa") call abort()
      END

      call test1()
      call test2()
      call test3()
      call test4()
      end