Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr17706.f90
blobf6787368fa7e78b653fbee9535034eea7d4ed1dd
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
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
17 s = x
18 write (s, '(SS,F4.1)') small
19 if (s .ne. " 0.0") call abort
21 s = x
22 write (s, '(SP,F4.1)') small
23 if (s .ne. "+0.0") call abort
24 end program