Files
TheRock/compiler/amd-llvm/flang/test/Lower/OpenMP/declare-target-deferred-marking.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

61 lines
2.7 KiB
Fortran

!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | FileCheck %s --check-prefixes ALL,HOST
!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -fopenmp-is-device %s -o - | FileCheck %s --check-prefixes ALL
program main
use, intrinsic :: iso_c_binding
implicit none
interface
subroutine any_interface() bind(c,name="any_interface")
use, intrinsic :: iso_c_binding
implicit none
!$omp declare target enter(any_interface) device_type(any)
end subroutine any_interface
subroutine host_interface() bind(c,name="host_interface")
use, intrinsic :: iso_c_binding
implicit none
!$omp declare target enter(host_interface) device_type(host)
end subroutine host_interface
subroutine device_interface() bind(c,name="device_interface")
use, intrinsic :: iso_c_binding
implicit none
!$omp declare target enter(device_interface) device_type(nohost)
end subroutine device_interface
subroutine called_from_target_interface(f1, f2) bind(c,name="called_from_target_interface")
use, intrinsic :: iso_c_binding
implicit none
type(c_funptr),value :: f1
type(c_funptr),value :: f2
end subroutine called_from_target_interface
subroutine called_from_host_interface(f1) bind(c,name="called_from_host_interface")
use, intrinsic :: iso_c_binding
implicit none
type(c_funptr),value :: f1
end subroutine called_from_host_interface
subroutine unused_unemitted_interface() bind(c,name="unused_unemitted_interface")
use, intrinsic :: iso_c_binding
implicit none
!$omp declare target enter(unused_unemitted_interface) device_type(nohost)
end subroutine unused_unemitted_interface
end interface
CALL called_from_host_interface(c_funloc(host_interface))
!$omp target
CALL called_from_target_interface(c_funloc(any_interface), c_funloc(device_interface))
!$omp end target
end program main
!HOST-LABEL: func.func {{.*}} @host_interface()
!HOST-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter), automap = false>{{.*}}
!ALL-LABEL: func.func {{.*}} @called_from_target_interface(!fir.ref<i64>, !fir.ref<i64>)
!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), automap = false>{{.*}}
!ALL-LABEL: func.func {{.*}} @any_interface()
!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>{{.*}}
!ALL-LABEL: func.func {{.*}} @device_interface()
!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}