OSDN Git Service

2008-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / fmt_zero_digits.f90
1 ! { dg-do run }
2 ! Verify that when decimal precision is zero, error error given except with 1P.
3 ! Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4 ! Modified for fix to PR35036
5 program test
6   implicit none
7   character(20) :: astr
8   integer       :: istat
9   50 FORMAT (1PD20.0)
10   astr = ""
11   write(astr,50) -8.0D0
12   if (astr.ne."             -8.D+00") call abort
13   write(astr,50) 8.0D0
14   if (astr.ne."              8.D+00") call abort
15   write(astr, '(E15.0)', iostat=istat) 1e5
16   if (istat /= 5006) call abort
17   write(astr, '(D15.0)', iostat=istat) 1e5
18   if (istat /= 5006) call abort
19   write(astr, '(G15.0)', iostat=istat) 1e5
20   if (istat /= 5006) call abort
21   write(astr, '(2PE15.0)', iostat=istat) 1e5
22   if (istat /= 5006) call abort
23   write(astr, '(0PE15.0)', iostat=istat) 1e5
24   if (istat /= 5006) call abort
25   write(astr, '(1PE15.0)', iostat=istat) 1e5
26   if (istat /= 0) call abort
27   write(astr, '(F15.0)', iostat=istat) 1e5
28   if (astr.ne."        100000.") call abort
29   if (istat /= 0) call abort
30 end program test