2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Feb 2008 02:22:45 +0000 (02:22 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Feb 2008 02:22:45 +0000 (02:22 +0000)
PR libfortran/35036
* gfortran.dg/fmt_zero_digits.f90: Revise test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132511 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/fmt_zero_digits.f90

index 4973788..764f99f 100644 (file)
@@ -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.
index adb3071..e734239 100644 (file)
@@ -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