annotate gcc/testsuite/gfortran.dg/mod_large_1.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! PR fortran/24518
kono
parents:
diff changeset
3 ! MOD/MODULO of large arguments.
kono
parents:
diff changeset
4 ! The naive algorithm goes pear-shaped for large arguments, instead
kono
parents:
diff changeset
5 ! use fmod.
kono
parents:
diff changeset
6 ! Here we test only with constant arguments (evaluated with
kono
parents:
diff changeset
7 ! mpfr_fmod), as we don't want to cause failures on targets with a
kono
parents:
diff changeset
8 ! crappy libm.
kono
parents:
diff changeset
9 program mod_large_1
kono
parents:
diff changeset
10 implicit none
kono
parents:
diff changeset
11 real :: r1
kono
parents:
diff changeset
12 r1 = mod (1e22, 1.7)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
13 if (abs(r1 - 0.995928764) > 1e-5) STOP 1
111
kono
parents:
diff changeset
14 r1 = modulo (1e22, -1.7)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
15 if (abs(r1 + 0.704071283) > 1e-5) STOP 2
111
kono
parents:
diff changeset
16 end program mod_large_1