PR rtl-optimization/82913
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / intrinsic_integer.f90
blob43578ed54a79244c9ac3b0d5802f68b240806e78
1 ! Program to test the real->integer conversion routines.
2 program intrinsic_integer
3 implicit none
5 call test (0.0, (/0, 0, 0, 0/))
6 call test (0.3, (/0, 1, 0, 0/))
7 call test (0.7, (/0, 1, 0, 1/))
8 call test (-0.3, (/-1, 0, 0, 0/))
9 call test (-0.7, (/-1, 0, 0, -1/))
10 contains
11 subroutine test(val, res)
12 real :: val
13 integer, dimension(4) :: res
15 if ((floor(val) .ne. res(1)) .or. (ceiling(val) .ne. res(2)) &
16 .or. (int(val) .ne. res(3)) .or. (nint(val) .ne. res(4))) call abort
17 end subroutine
18 end program