OSDN Git Service

ChangeLogs fixed, again.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / round_1.f03
1 ! { dg-do run }
2 ! PR35962 Implement F2003 rounding modes.
3 ! Test case prepared by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4 character(11) :: fmt(7)
5 character(80) :: line
6 integer :: i
7 fmt = (/'(RU,6F10.1)', '(RD,6F10.1)', '(RZ,6F10.1)', &
8         '(RN,6F10.2)', '(RC,6F10.2)', '(RP,6F10.1)', &
9         '(SP,6F10.1)' /)
10 do i = 1, 7
11    !print fmt(i), 1.20, 1.22, 1.25, 1.27, 1.30, 1.125
12 end do
13 write(line, fmt(1)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125
14 if (line.ne."       1.3       1.3       1.3       1.3       1.3       1.2") call abort
15 write(line, fmt(2)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125
16 if (line.ne."       1.2       1.2       1.2       1.2       1.2       1.1") call abort
17 write(line, fmt(3)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125
18 if (line.ne."       1.2       1.2       1.2       1.2       1.2       1.1") call abort
19 write(line, fmt(4)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125
20 if (line.ne."      1.20      1.22      1.25      1.27      1.30      1.12") call abort
21 write(line, fmt(5)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125
22 if (line.ne."      1.20      1.22      1.25      1.27      1.30      1.13") call abort
23 write(line, fmt(6)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125
24 if (line.ne."       1.2       1.2       1.3       1.3       1.3       1.1") call abort
25 write(line, fmt(7)) 1.20, 1.22, 1.25, 1.27, 1.30, 1.125
26 if (line.ne."      +1.2      +1.2      +1.3      +1.3      +1.3      +1.1") call abort
27
28 end