aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2008-02-21 02:22:45 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2008-02-21 02:22:45 +0000
commitd5e0c0ae6254a3b019855e77df5c3af25a7da1db (patch)
tree80905261c88234ce945cb4b86866470f97542fc5 /gcc
parent50a932e0cb654d9c1212a482bfc401d64b716df3 (diff)
downloadgcc-d5e0c0ae6254a3b019855e77df5c3af25a7da1db.zip
gcc-d5e0c0ae6254a3b019855e77df5c3af25a7da1db.tar.gz
gcc-d5e0c0ae6254a3b019855e77df5c3af25a7da1db.tar.bz2
re PR fortran/35036 (illegal E format descriptor produces wrong output)
2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/35036 * gfortran.dg/fmt_zero_digits.f90: Revise test. From-SVN: r132511
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_zero_digits.f9026
2 files changed, 27 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4973788..764f99f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/35036
+ * gfortran.dg/fmt_zero_digits.f90: Revise test.
+
2008-02-20 Seongbae Park <seongbae.park@gmail.com>
* gcc.dg/Wframe-larger-than.c: New option test.
diff --git a/gcc/testsuite/gfortran.dg/fmt_zero_digits.f90 b/gcc/testsuite/gfortran.dg/fmt_zero_digits.f90
index adb3071..e734239 100644
--- a/gcc/testsuite/gfortran.dg/fmt_zero_digits.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_zero_digits.f90
@@ -1,12 +1,30 @@
! { dg-do run }
-! Verify that when decimal precision is zero, no error.
+! Verify that when decimal precision is zero, error error given except with 1P.
! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+! Modified for fix to PR35036
program test
+ implicit none
character(20) :: astr
- 50 FORMAT (d20.0)
+ integer :: istat
+ 50 FORMAT (1PD20.0)
astr = ""
write(astr,50) -8.0D0
- if (astr.ne." -0.D+01") call abort()
+ if (astr.ne." -8.D+00") call abort
write(astr,50) 8.0D0
- if (astr.ne." 0.D+01") call abort()
+ if (astr.ne." 8.D+00") call abort
+ write(astr, '(E15.0)', iostat=istat) 1e5
+ if (istat /= 5006) call abort
+ write(astr, '(D15.0)', iostat=istat) 1e5
+ if (istat /= 5006) call abort
+ write(astr, '(G15.0)', iostat=istat) 1e5
+ if (istat /= 5006) call abort
+ write(astr, '(2PE15.0)', iostat=istat) 1e5
+ if (istat /= 5006) call abort
+ write(astr, '(0PE15.0)', iostat=istat) 1e5
+ if (istat /= 5006) call abort
+ write(astr, '(1PE15.0)', iostat=istat) 1e5
+ if (istat /= 0) call abort
+ write(astr, '(F15.0)', iostat=istat) 1e5
+ if (astr.ne." 100000.") call abort
+ if (istat /= 0) call abort
end program test