summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/fmt_f0_1.f90
blob: dd66f6557e9003d5dbf0d2a6fc02848663e6afc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
! { dg-do run }
! PR39304 write of  0.0 with F0.3 gives  **
! PR47567 Small absolute values.
! Test case developed from case provided by reporter.
 REAL :: x
 CHARACTER(80) :: str
 x = 0.0
 write (str,'(f0.0)') x
 if (str.ne."0.") call abort
 write (str,'(f0.1)') x
 if (str.ne.".0") call abort
 write (str,'(f0.2)') x
 if (str.ne.".00") call abort
 write (str,'(f0.3)') x
 if (str.ne.".000") call abort
 write (str,'(f0.4)') x
 if (str.ne.".0000") call abort
 write (str,'(F0.0)') 0.0
 if (str.ne."0.") call abort
 write (str,'(F0.0)') 0.001
 if (str.ne."0.") call abort
 write (str,'(F0.0)') 0.01
 if (str.ne."0.") call abort
 write (str,'(F0.0)') 0.1
 if (str.ne."0.") call abort
 write (str,'(F1.0)') -0.0
 if (str.ne."*") call abort
 write (str,'(F1.0)') 0.001
 if (str.ne."*") call abort
 write (str,'(F1.0)') 0.01
 if (str.ne."*") call abort
 write (str,'(F1.0)') 0.1
 if (str.ne."*") call abort
 write (str,'(F2.0)') -0.001
 if (str.ne."**") call abort
 write (str,'(F2.0)') -0.01
 if (str.ne."**") call abort
 write (str,'(F2.0)') -0.1
 if (str.ne."**") call abort
 write (str,'(F0.2)') 0.0
 if (str.ne.".00") call abort
 write (str,'(F0.0)') -0.0
 if (str.ne."-0.") call abort
 write (str,'(F0.1)') -0.0
 if (str.ne."-.0") call abort
 write (str,'(F0.2)') -0.0
 if (str.ne."-.00") call abort
 write (str,'(F0.3)') -0.0
 if (str.ne."-.000") call abort
 write (str,'(F3.0)') -0.0
 if (str.ne."-0.") call abort
 write (str,'(F2.0)') -0.0
 if (str.ne."**") call abort
 write (str,'(F1.0)') -0.0
 if (str.ne."*") call abort
 write (str,'(F0.1)') -0.0
 if (str.ne."-.0") call abort
 write (str,'(F3.1)') -0.0
 if (str.ne."-.0") call abort
 write (str,'(F2.1)') -0.0
 if (str.ne."**") call abort
 write (str,'(F1.1)') -0.0
 if (str.ne."*") call abort
 END