Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / round_1.f03
blob9ee75b70f43a069aaf813e495c707739a4a66bc7
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") STOP 1
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") STOP 2
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") STOP 3
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") STOP 4
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") STOP 5
23 write(line, fmt(6)) 1.20, 1.22, 1.250001, 1.27, 1.30, 1.125
24 if (line.ne."       1.2       1.2       1.3       1.3       1.3       1.1") STOP 6
25 write(line, fmt(7)) 1.20, 1.22, 1.250001, 1.27, 1.30, 1.125
26 if (line.ne."      +1.2      +1.2      +1.3      +1.3      +1.3      +1.1") STOP 7
28 end