summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/string_4.f90
blob: 12f501bb9ab90c0871106f014d5ec960fafe9bde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
! { 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