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

98 lines
3.0 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
! Tests for ignore_tkr(ac) (allocatable/all + contiguous) with pointers
! Should suppress warnings about applying to pointer/descriptor
! and suppress errors about rank/type mismatch.
module m_ptr_tkr
interface
subroutine s1(p)
real, pointer :: p(:)
!dir$ ignore_tkr(ac) p
end subroutine
subroutine s2(p)
real, allocatable :: p(:)
!dir$ ignore_tkr(ac) p
end subroutine
subroutine s_ct(p)
real, pointer :: p(:)
!dir$ ignore_tkr(ct) p
end subroutine
subroutine s_c(p)
integer, pointer :: p(:)
!dir$ ignore_tkr(c) p
end subroutine
subroutine s_ck(p)
real, pointer :: p(:)
!dir$ ignore_tkr(ck) p
end subroutine
subroutine s_cr(p)
real, pointer :: p(:)
!dir$ ignore_tkr(cr) p
end subroutine
subroutine s_ckr(p)
real, pointer :: p(:)
!dir$ ignore_tkr(ckr) p
end subroutine
subroutine s_ctr(p)
real, pointer :: p(:)
!dir$ ignore_tkr(ctr) p
end subroutine
subroutine s_ctk(p)
real, pointer :: p(:)
!dir$ ignore_tkr(ctk) p
end subroutine
end interface
contains
subroutine test_ptr_tkr()
real(8), pointer :: p3(:,:,:)
real(8), allocatable :: a3(:,:,:)
! Rank mismatch (1 vs 3), Type mismatch (real(4) vs real(8))
! Should be ignored due to ignore_tkr(ac) which implies TKR + C.
call s1(p3)
call s2(a3)
! ignore_tkr(c): still have type/kind/rank differences
!ERROR: Actual argument type 'REAL(8)' is not compatible with dummy argument type 'INTEGER(4)'
!ERROR: Pointer has rank 1 but target has rank 3
call s_c(p3)
! ignore_tkr(ct): ignore type differences, still have kind/rank differences
!ERROR: Actual argument type 'REAL(8)' is not compatible with dummy argument type 'REAL(4)'
!ERROR: Pointer has rank 1 but target has rank 3
call s_ct(p3)
! ignore_tkr(ck): ignore kind differences, still have type/rank differences
!ERROR: Rank of dummy argument is 1, but actual argument has rank 3
!ERROR: Pointer has rank 1 but target has rank 3
call s_ck(p3)
! ignore_tkr(cr): ignore rank differences, still have type/kind differences
!ERROR: Actual argument type 'REAL(8)' is not compatible with dummy argument type 'REAL(4)'
!ERROR: Target type REAL(8) is not compatible with pointer type REAL(4)
call s_cr(p3)
! ignore_tkr(ckr): ignore kind/rank differences, still have type differences
!ERROR: Target type REAL(8) is not compatible with pointer type REAL(4)
call s_ckr(p3)
! ignore_tkr(ctr): ignore type/rank differences, still have kind differences
!ERROR: Actual argument type 'REAL(8)' is not compatible with dummy argument type 'REAL(4)'
call s_ctr(p3)
! ignore_tkr(ctk): ignore type/kind differences, still have rank differences
!ERROR: Rank of dummy argument is 1, but actual argument has rank 3
!ERROR: Pointer has rank 1 but target has rank 3
call s_ctk(p3)
end subroutine
end module