OSDN Git Service

PR libfortran/18271
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / pr17706.f90
1 ! { dg-do run }
2 ! PR17706
3 ! this is a libgfortran test
4 ! output value -0.00 is not standard compliant
5 ! derived from NIST F77 test FM406, with extra bits added.
6 program pr17706
7   implicit none
8   character(len=10) :: s
9   character(len=10), parameter :: x = "xxxxxxxxxx"
10   real, parameter :: small = -0.0001
11
12   s = x
13   write (s, '(F4.1)') small
14   ! The plus is optional.  We choose not to display it.
15   if (s .ne. " 0.0") call abort
16
17   s = x
18   write (s, '(SS,F4.1)') small
19   if (s .ne. " 0.0") call abort
20
21   s = x
22   write (s, '(SP,F4.1)') small
23   if (s .ne. "+0.0") call abort
24 end program