summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/f2003_io_7.f03
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/f2003_io_7.f03
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/f2003_io_7.f03')
-rw-r--r--gcc/testsuite/gfortran.dg/f2003_io_7.f0327
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/f2003_io_7.f03 b/gcc/testsuite/gfortran.dg/f2003_io_7.f03
new file mode 100644
index 000000000..6d2c11dfc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/f2003_io_7.f03
@@ -0,0 +1,27 @@
+! { dg-do run }
+! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+! Test of sign=, decimal=, and blank= .
+program iotests
+ implicit none
+ character(len=45) :: a
+ character(len=4) :: mode = "what"
+ real, parameter :: pi = 3.14159265358979323846
+ real(kind=8), dimension(3) :: b
+ !
+ write(a,'(f10.3,s,f10.3,sp,f10.3,ss,f10.3)',SIGN='PLUS') pi, pi, pi, pi
+ if (a /= " +3.142 3.142 +3.142 3.142") call abort
+ !
+ open(8,sign="plus")
+ write(8,'(f10.3,dc,f10.3,dp,f10.3)',DECIMAL='COMMA',&
+ & sign="suppress") pi, pi, pi
+ rewind(8)
+ read(8,'(a)') a
+ if (a /= " 3,142 3,142 3.142") call abort
+ close(8,status="delete")
+ !
+ ! "123456789 123456789 12345678901
+ write(a,'(a)') "53 256.84, 2 2 2. ; 33.3 3 1 "
+ read(a, '(f9.2,1x,f8.2,2x,f11.7)', blank="zero") b(1),b(2),b(3)
+ if (any(abs(b - [530256.84, 20202.00, 33.3030001]) > .03)) call abort
+end program iotests
+