Debian Codegraph @

gcc/testsuite/gfortran.dg/ieee/rounding_3.f90

raw
1 ! { dg-do run }
2
3 ! Test IEEE_GET_ROUNDING_MODE and IEEE_SET_ROUNDING_MODE
4 ! with a RADIX argument
5 use, intrinsic :: ieee_arithmetic
6 implicit none
7
8 real :: sx1
9 type(ieee_round_type) :: r
10
11 if (ieee_support_rounding(ieee_up, sx1) .and. &
12 ieee_support_rounding(ieee_down, sx1)) then
13
14 call ieee_set_rounding_mode(ieee_up)
15 call ieee_get_rounding_mode(r)
16 if (r /= ieee_up) stop 1
17
18 call ieee_set_rounding_mode(ieee_down, radix=2)
19 call ieee_get_rounding_mode(r, radix=2)
20 if (r /= ieee_down) stop 2
21
22 call ieee_set_rounding_mode(ieee_up, radix=10)
23 call ieee_get_rounding_mode(r, radix=2)
24 if (r /= ieee_down) stop 3
25 end if
26
27 end