Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / nearest_1.f90
blobae9e75f1e8f25697722aaa799dcb7bad37117f6c
1 ! { dg-do run }
2 ! { dg-options "-O0 -ffloat-store" }
3 ! { dg-add-options ieee }
4 ! { dg-skip-if "Denormals not supported" { spu-*-* } { "*" } { "" } }
5 ! PR fortran/27021
6 ! Original code submitted by Dominique d'Humieres
7 ! Converted to Dejagnu for the testsuite by Steven G. Kargl
8 program chop
9 integer ix, iy
10 real o, t, td, tu, x, y
11 o = 1.
12 t = tiny(o)
13 td = nearest(t,-1.0)
14 x = td/2.0
15 y = nearest(tiny(o),-1.0)/2.0
16 ix = transfer(x,ix)
17 iy = transfer(y,iy)
18 if (ix /= iy) call abort
19 end program chop