Files
TheRock/compiler/amd-llvm/flang/test/Semantics/cuf03.cuf
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

111 lines
3.8 KiB
Plaintext

! RUN: %python %S/test_errors.py %s %flang_fc1
! Exercise CUDA data attribute checks
module m
type :: t1
integer :: i
end type
type :: t2
real, unified :: r(10) ! ok
end type
real, constant :: mc ! ok
real, constant :: mci = 1. ! ok
!ERROR: Object 'mcl' with ATTRIBUTES(CONSTANT) may not be allocatable, pointer, or target
real, constant, allocatable :: mcl
!ERROR: Object 'mcp' with ATTRIBUTES(CONSTANT) may not be allocatable, pointer, or target
real, constant, pointer :: mcp
!ERROR: Object 'mct' with ATTRIBUTES(CONSTANT) may not be allocatable, pointer, or target
real, constant, target :: mct
real, device :: md ! ok
real, device :: mdi = 1.
real, device, allocatable :: mdl ! ok
real, device, pointer :: mdp ! ok at module level
real, device, target :: mdt ! ok
!ERROR: Object 'ms' with ATTRIBUTES(SHARED) must be declared in a device subprogram
real, shared :: ms
!ERROR: Object 'msi' with ATTRIBUTES(SHARED) must be declared in a device subprogram
real, shared :: msi = 1.
!ERROR: Object 'msl' with ATTRIBUTES(SHARED) may not be allocatable, pointer, or target
real, shared, allocatable :: msl
!ERROR: Object 'msp' with ATTRIBUTES(SHARED) may not be allocatable, pointer, or target
real, shared, pointer :: msp
!ERROR: Object 'mst' with ATTRIBUTES(SHARED) may not be allocatable, pointer, or target
real, shared, target :: mst
!ERROR: Object 'msa' with ATTRIBUTES(SHARED) must be declared in a device subprogram
real, shared :: msa(*)
real, managed :: mm ! ok
real, managed :: mmi = 1. ! ok
real, managed, allocatable :: mml ! ok
real, managed, pointer :: mmp(:) ! ok
real, managed, target :: mmt
!WARNING: Object 'mp' with ATTRIBUTES(PINNED) should also be allocatable [-Wcuda-usage]
real, pinned :: mp
!WARNING: Object 'mpi' with ATTRIBUTES(PINNED) should also be allocatable [-Wcuda-usage]
real, pinned :: mpi = 1.
real, pinned, allocatable :: mpl ! ok
!ERROR: Object 'mpp' with ATTRIBUTES(PINNED) may not be a pointer [-Wcuda-usage]
real, pinned, pointer :: mpp
!WARNING: Object 'mpt' with ATTRIBUTES(PINNED) should also be allocatable [-Wcuda-usage]
real, pinned, target :: mpt ! ok
!ERROR: ATTRIBUTES(TEXTURE) is obsolete and no longer supported
real, texture, pointer :: mt
!ERROR: 'bigint' has intrinsic type 'INTEGER(16)' that is not available on the device
integer(16), device :: bigint
!ERROR: Object 'um' with ATTRIBUTES(UNIFIED) must be declared in a host subprogram
real, unified :: um
type :: t3
!ERROR: Component 'r' with ATTRIBUTES(DEVICE) must also be allocatable or pointer
real, device :: r
real, device, pointer :: rp ! ok
real, device, allocatable :: ra ! ok
real, device, pointer, contiguous :: rpc ! ok
end type
contains
attributes(device) subroutine devsubr(n,da,rs)
integer, intent(in) :: n
real, device :: da(*) ! ok
real, managed :: ma(n) ! ok
!WARNING: Pointer 'dp' may not be associated in a device subprogram [-Wcuda-usage]
real, device, pointer :: dp
real, constant :: rc ! ok
real, shared :: rs ! ok
!ERROR: Object 'u' with ATTRIBUTES(UNIFIED) must be declared in a host subprogram
real, unified :: u
end subroutine
subroutine host()
!ERROR: Object 'rc' with ATTRIBUTES(CONSTANT) may not be declared in a host subprogram
real, constant :: rc
end subroutine
attributes(global) subroutine devsubr2()
real, shared :: rs
rs = 1 ! ok
end subroutine
subroutine host2()
real, unified :: ru ! ok
type(t1), unified :: tu ! ok
type(t2) :: t ! ok
block
real, device :: a(100) ! ok
end block
end subroutine
attributes(global) subroutine dev2(a)
integer, intent(in) :: a
attributes(value) :: a
! this is equivalent to:
! integer, intent(in), value :: a
end subroutine
end module
program p
real, unified :: um ! ok
end program