Files
TheRock/compiler/amd-llvm/flang/test/Lower/array-elemental-subroutines.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

49 lines
1.9 KiB
Fortran

! Test lowering of elemental subroutine calls with array arguments
! RUN: bbc -emit-hlfir %s -o - | FileCheck %s
! CHECK-LABEL: func @_QPtest_elem_sub(
! CHECK-SAME: %[[VAL_0:.*]]: !fir.box<!fir.array<?xf32>>{{.*}}, %[[VAL_1:.*]]: !fir.box<!fir.array<?x!fir.char<1,?>>>{{.*}}, %[[VAL_2:.*]]: !fir.ref<i32>{{.*}}, %[[VAL_3:.*]]: !fir.ref<complex<f32>>{{.*}}) {
! CHECK: %[[c_decl:.*]]:2 = hlfir.declare %[[VAL_1]]
! CHECK: %[[i_decl:.*]]:2 = hlfir.declare %[[VAL_2]]
! CHECK: %[[x_decl:.*]]:2 = hlfir.declare %[[VAL_0]]
! CHECK: %[[z_decl:.*]]:2 = hlfir.declare %[[VAL_3]]
! CHECK: %[[len:.*]] = fir.box_elesize %[[c_decl]]#1
! CHECK: %[[slice:.*]] = hlfir.designate %[[c_decl]]#0 ({{.*}}) shape {{.*}} typeparams %[[len]]
! CHECK: %[[z_val:.*]] = fir.load %[[z_decl]]#0
! CHECK: fir.do_loop %[[arg:.*]] = {{.*}} {
! CHECK: %[[x_elem:.*]] = hlfir.designate %[[x_decl]]#0 (%[[arg]])
! CHECK: %[[c_elem:.*]] = hlfir.designate %[[slice]] (%[[arg]]) typeparams %[[len]]
! CHECK: fir.call @_QPfoo(%[[x_elem]], %[[c_elem]], %[[i_decl]]#0, %[[z_val]])
! CHECK: }
subroutine test_elem_sub(x, c, i, z)
real :: x(:)
character(*) :: c(:)
integer :: i
complex :: z
interface
elemental subroutine foo(x, c, i, z)
real, intent(out) :: x
character(*), intent(inout) :: c
integer, intent(in) :: i
complex, value :: z
end subroutine
end interface
call foo(x, c(10:1:-1), i, z)
end subroutine
! CHECK-LABEL: func @_QPtest_elem_sub_no_array_args(
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<i32>{{.*}}, %[[VAL_1:.*]]: !fir.ref<i32>{{.*}}) {
subroutine test_elem_sub_no_array_args(i, j)
integer :: i, j
interface
elemental subroutine bar(i, j)
integer, intent(out) :: i
integer, intent(in) :: j
end subroutine
end interface
call bar(i, j)
! CHECK: fir.call @_QPbar(%{{.*}}, %{{.*}})
end subroutine