1 ! Test the BGE, BGT, BLE and BLT intrinsics.
4 ! { dg-options "-ffree-line-length-none" }
5 ! { dg-require-effective-target fortran_integer_16 }
7 #define CHECK(I,J,RES) \
8 if (bge(I,J) .neqv. RES) call abort ; \
9 if (run_bge(I,J) .neqv. RES) call abort ; \
10 if (bgt(I,J) .neqv. (RES .and. (I/=J))) call abort ; \
11 if (run_bgt(I,J) .neqv. (RES .and. (I/=J))) call abort ; \
12 if (ble(J,I) .neqv. RES) call abort ; \
13 if (run_ble(J,I) .neqv. RES) call abort ; \
14 if (blt(J,I) .neqv. (RES .and. (I/=J))) call abort ; \
15 if (run_blt(J,I) .neqv. (RES .and. (I/=J))) call abort
22 CHECK(0_16, 107_16, F)
23 CHECK(5_16, huge(0_16) / 2_16, F)
24 CHECK(5_16, huge(0_16), F)
26 CHECK(0_16, -19_16, F)
27 CHECK(huge(0_16), -19_16, F)
31 pure logical function run_bge (i, j) result(res)
32 integer(kind=16), intent(in) :: i, j
35 pure logical function run_bgt (i, j) result(res)
36 integer(kind=16), intent(in) :: i, j
39 pure logical function run_ble (i, j) result(res)
40 integer(kind=16), intent(in) :: i, j
43 pure logical function run_blt (i, j) result(res)
44 integer(kind=16), intent(in) :: i, j