CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
110 lines
3.2 KiB
Fortran
110 lines
3.2 KiB
Fortran
! RUN: %flang_fc1 -emit-hlfir %s -o "-" | FileCheck %s
|
|
|
|
! Test real intrinsic operation lowering to FIR.
|
|
|
|
! CHECK-LABEL:eq0_test
|
|
LOGICAL FUNCTION eq0_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:[[reg3:%[0-9]+]] = arith.cmpf oeq, [[reg1]], [[reg2]] {{.*}} : f32
|
|
! CHECK:fir.convert [[reg3]] {{.*}} -> !fir.logical<4>
|
|
eq0_test = x0 .EQ. x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:ne1_test
|
|
LOGICAL FUNCTION ne1_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:[[reg3:%[0-9]+]] = arith.cmpf une, [[reg1]], [[reg2]] {{.*}} : f32
|
|
! CHECK:fir.convert [[reg3]] {{.*}} -> !fir.logical<4>
|
|
ne1_test = x0 .NE. x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:lt2_test
|
|
LOGICAL FUNCTION lt2_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:[[reg3:%[0-9]+]] = arith.cmpf olt, [[reg1]], [[reg2]] {{.*}} : f32
|
|
! CHECK:fir.convert [[reg3]] {{.*}} -> !fir.logical<4>
|
|
lt2_test = x0 .LT. x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:le3_test
|
|
LOGICAL FUNCTION le3_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:[[reg3:%[0-9]+]] = arith.cmpf ole, [[reg1]], [[reg2]] {{.*}} : f32
|
|
! CHECK:fir.convert [[reg3]] {{.*}} -> !fir.logical<4>
|
|
le3_test = x0 .LE. x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:gt4_test
|
|
LOGICAL FUNCTION gt4_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:[[reg3:%[0-9]+]] = arith.cmpf ogt, [[reg1]], [[reg2]] {{.*}} : f32
|
|
! CHECK:fir.convert [[reg3]] {{.*}} -> !fir.logical<4>
|
|
gt4_test = x0 .GT. x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:ge5_test
|
|
LOGICAL FUNCTION ge5_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:[[reg3:%[0-9]+]] = arith.cmpf oge, [[reg1]], [[reg2]] {{.*}} : f32
|
|
! CHECK:fir.convert [[reg3]] {{.*}} -> !fir.logical<4>
|
|
ge5_test = x0 .GE. x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:add6_test
|
|
REAL(4) FUNCTION add6_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:addf [[reg1]], [[reg2]] {{.*}}: f32
|
|
add6_test = x0 + x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:sub7_test
|
|
REAL(4) FUNCTION sub7_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:subf [[reg1]], [[reg2]] {{.*}}: f32
|
|
sub7_test = x0 - x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:mult8_test
|
|
REAL(4) FUNCTION mult8_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:mulf [[reg1]], [[reg2]] {{.*}}: f32
|
|
mult8_test = x0 * x1
|
|
END FUNCTION
|
|
|
|
! CHECK-LABEL:div9_test
|
|
REAL(4) FUNCTION div9_test(x0, x1)
|
|
REAL(4) :: x0
|
|
REAL(4) :: x1
|
|
! CHECK-DAG:[[reg1:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK-DAG:[[reg2:%[0-9]+]] = fir.load %{{.*}}
|
|
! CHECK:divf [[reg1]], [[reg2]] {{.*}}: f32
|
|
div9_test = x0 / x1
|
|
END FUNCTION
|