summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/string_4.f90
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/string_4.f90
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/string_4.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/string_4.f9051
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/string_4.f90 b/gcc/testsuite/gfortran.dg/string_4.f90
new file mode 100644
index 000000000..12f501bb9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/string_4.f90
@@ -0,0 +1,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