Files
TheRock/compiler/amd-llvm/flang/test/Lower/logical-operations.f90
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

69 lines
2.4 KiB
Fortran

! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s
! Test logical intrinsic operation lowering to fir.
! CHECK-LABEL: func.func @_QPeqv0_test
LOGICAL(1) FUNCTION eqv0_test(x0, x1)
LOGICAL(1) :: x0
LOGICAL(1) :: x1
! CHECK: %[[X0:.*]]:2 = hlfir.declare %arg0
! CHECK: %[[X1:.*]]:2 = hlfir.declare %arg1
! CHECK: %[[V0:.*]] = fir.load %[[X0]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %[[V1:.*]] = fir.load %[[X1]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %[[EQV:.*]] = fir.eqv %[[V0]], %[[V1]] : !fir.logical<1>
! CHECK: hlfir.assign %[[EQV]]
eqv0_test = x0 .EQV. x1
END FUNCTION
! CHECK-LABEL: func.func @_QPneqv1_test
LOGICAL(1) FUNCTION neqv1_test(x0, x1)
LOGICAL(1) :: x0
LOGICAL(1) :: x1
! CHECK: %[[X0:.*]]:2 = hlfir.declare %arg0
! CHECK: %[[X1:.*]]:2 = hlfir.declare %arg1
! CHECK: %[[V0:.*]] = fir.load %[[X0]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %[[V1:.*]] = fir.load %[[X1]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %[[NEQV:.*]] = fir.neqv %[[V0]], %[[V1]] : !fir.logical<1>
! CHECK: hlfir.assign %[[NEQV]]
neqv1_test = x0 .NEQV. x1
END FUNCTION
! CHECK-LABEL: func.func @_QPor2_test
LOGICAL(1) FUNCTION or2_test(x0, x1)
LOGICAL(1) :: x0
LOGICAL(1) :: x1
! CHECK: %[[X0:.*]]:2 = hlfir.declare %arg0
! CHECK: %[[X1:.*]]:2 = hlfir.declare %arg1
! CHECK: %[[V0:.*]] = fir.load %[[X0]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %[[V1:.*]] = fir.load %[[X1]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %[[OR:.*]] = fir.logical_or %[[V0]], %[[V1]] : !fir.logical<1>
! CHECK: hlfir.assign %[[OR]]
or2_test = x0 .OR. x1
END FUNCTION
! CHECK-LABEL: func.func @_QPand3_test
LOGICAL(1) FUNCTION and3_test(x0, x1)
LOGICAL(1) :: x0
LOGICAL(1) :: x1
! CHECK: %[[X0:.*]]:2 = hlfir.declare %arg0
! CHECK: %[[X1:.*]]:2 = hlfir.declare %arg1
! CHECK: %[[V0:.*]] = fir.load %[[X0]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %[[V1:.*]] = fir.load %[[X1]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %[[AND:.*]] = fir.logical_and %[[V0]], %[[V1]] : !fir.logical<1>
! CHECK: hlfir.assign %[[AND]]
and3_test = x0 .AND. x1
END FUNCTION
! CHECK-LABEL: func.func @_QPnot4_test
LOGICAL(1) FUNCTION not4_test(x0)
LOGICAL(1) :: x0
! CHECK: %[[X0:.*]]:2 = hlfir.declare %arg0
! CHECK: %[[V0:.*]] = fir.load %[[X0]]#0 : !fir.ref<!fir.logical<1>>
! CHECK: %true = arith.constant true
! CHECK: %[[B0:.*]] = fir.convert %[[V0]] : (!fir.logical<1>) -> i1
! CHECK: %[[NOT:.*]] = arith.xori %[[B0]], %true : i1
! CHECK: %[[RES:.*]] = fir.convert %[[NOT]] : (i1) -> !fir.logical<1>
! CHECK: hlfir.assign %[[RES]]
not4_test = .NOT. x0
END FUNCTION