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
67 lines
2.8 KiB
Fortran
67 lines
2.8 KiB
Fortran
! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck %s
|
|
|
|
module m1
|
|
external :: sub
|
|
external :: fun
|
|
|
|
type ty
|
|
procedure(), pointer, nopass :: ptr5 => fun
|
|
end type
|
|
|
|
type t
|
|
procedure(), pointer, nopass :: ptr5 => sub
|
|
end type
|
|
|
|
procedure(), pointer :: ptr6 => sub
|
|
end module
|
|
|
|
use m1
|
|
integer :: jj = 4
|
|
call ptr6(10)
|
|
call ptr5(10)
|
|
print *, "Pass"
|
|
end
|
|
|
|
subroutine sub(a)
|
|
integer :: a
|
|
print *, "sub"
|
|
end subroutine
|
|
|
|
integer function fun(a)
|
|
integer :: a
|
|
print *, "fun"
|
|
fun = a * 2
|
|
end function
|
|
|
|
! CHECK-LABEL: func.func @_QQmain() {
|
|
! CHECK: %[[PTR6_ADDR:.*]] = fir.address_of(@_QMm1Eptr6) : !fir.ref<!fir.boxproc<() -> ()>>
|
|
! CHECK: %[[PTR6:.*]]:2 = hlfir.declare %[[PTR6_ADDR]] {fortran_attrs = #fir.var_attrs<pointer>, uniq_name = "_QMm1Eptr6"}
|
|
! CHECK: %[[C10:.*]] = arith.constant 10 : i32
|
|
! CHECK: %[[TMP:.*]]:3 = hlfir.associate %[[C10]] {adapt.valuebyref} : (i32) -> (!fir.ref<i32>, !fir.ref<i32>, i1)
|
|
! CHECK: %[[P:.*]] = fir.load %[[PTR6]]#0 : !fir.ref<!fir.boxproc<() -> ()>>
|
|
! CHECK: %[[F:.*]] = fir.box_addr %[[P]] : (!fir.boxproc<() -> ()>) -> ((!fir.ref<i32>) -> ())
|
|
! CHECK: fir.call %[[F]](%[[TMP]]#0) fastmath<contract> : (!fir.ref<i32>) -> ()
|
|
! CHECK: hlfir.end_associate %[[TMP]]#1, %[[TMP]]#2 : !fir.ref<i32>, i1
|
|
|
|
! CHECK-LABEL: func.func @_QPsub(%arg0: !fir.ref<i32> {fir.bindc_name = "a"}) {
|
|
! CHECK: %[[SCOPE:.*]] = fir.dummy_scope : !fir.dscope
|
|
! CHECK: %[[A:.*]]:2 = hlfir.declare %arg0 dummy_scope %[[SCOPE]] arg 1 {uniq_name = "_QFsubEa"} : (!fir.ref<i32>, !fir.dscope) -> (!fir.ref<i32>, !fir.ref<i32>)
|
|
! CHECK: return
|
|
|
|
! CHECK-LABEL: func.func @_QPfun(%arg0: !fir.ref<i32> {fir.bindc_name = "a"}) -> i32 {
|
|
! CHECK: %[[SCOPE:.*]] = fir.dummy_scope : !fir.dscope
|
|
! CHECK: %[[A:.*]]:2 = hlfir.declare %arg0 dummy_scope %[[SCOPE]] arg 1 {uniq_name = "_QFfunEa"} : (!fir.ref<i32>, !fir.dscope) -> (!fir.ref<i32>, !fir.ref<i32>)
|
|
! CHECK: %[[FUN_ALLOCA:.*]] = fir.alloca i32 {bindc_name = "fun", uniq_name = "_QFfunEfun"}
|
|
! CHECK: %[[FUN:.*]]:2 = hlfir.declare %[[FUN_ALLOCA]] {uniq_name = "_QFfunEfun"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
|
|
! CHECK: %[[C2:.*]] = arith.constant 2 : i32
|
|
! CHECK: %[[LOAD_A:.*]] = fir.load %[[A]]#0 : !fir.ref<i32>
|
|
! CHECK: %[[MUL:.*]] = arith.muli %[[C2]], %[[LOAD_A]] : i32
|
|
! CHECK: hlfir.assign %[[MUL]] to %[[FUN]]#0 : i32, !fir.ref<i32>
|
|
! CHECK: %[[RESULT:.*]] = fir.load %[[FUN]]#0 : !fir.ref<i32>
|
|
! CHECK: return %[[RESULT]] : i32
|
|
|
|
! CHECK-LABEL: fir.global @_QMm1Eptr6 : !fir.boxproc<() -> ()> {
|
|
! CHECK: %[[ADDR:.*]] = fir.address_of(@_QPsub) : (!fir.ref<i32>) -> ()
|
|
! CHECK: %[[BOX:.*]] = fir.emboxproc %[[ADDR]] : ((!fir.ref<i32>) -> ()) -> !fir.boxproc<() -> ()>
|
|
! CHECK: fir.has_value %[[BOX]] : !fir.boxproc<() -> ()>
|