view 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
line wrap: on
line source

! { dg-do run }
! PR fortran/24518 
! MOD/MODULO of large arguments.
! The naive algorithm goes pear-shaped for large arguments, instead
! use fmod.
! Here we test only with constant arguments (evaluated with
! mpfr_fmod), as we don't want to cause failures on targets with a
! crappy libm.
program mod_large_1
  implicit none
  real :: r1
  r1 = mod (1e22, 1.7)
  if (abs(r1 - 0.995928764) > 1e-5) STOP 1
  r1 = modulo (1e22, -1.7)
  if (abs(r1 + 0.704071283) > 1e-5) STOP 2
end program mod_large_1