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
235 lines
5.0 KiB
Fortran
235 lines
5.0 KiB
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
|
|
! !DIR$ IGNORE_TKR tests
|
|
|
|
!ERROR: !DIR$ IGNORE_TKR directive must appear in a program unit
|
|
!dir$ ignore_tkr
|
|
|
|
module m
|
|
|
|
!WARNING: !DIR$ IGNORE_TKR directive should appear in a subroutine or function [-Wmisplaced-ignore-tkr]
|
|
!dir$ ignore_tkr
|
|
|
|
interface
|
|
subroutine t1(x)
|
|
!dir$ ignore_tkr
|
|
real, intent(in) :: x
|
|
end
|
|
|
|
subroutine t2(x)
|
|
!dir$ ignore_tkr(t) x
|
|
real, intent(in) :: x
|
|
end
|
|
|
|
subroutine t3(x)
|
|
!dir$ ignore_tkr(k) x
|
|
real, intent(in) :: x
|
|
end
|
|
|
|
subroutine t4(a)
|
|
!dir$ ignore_tkr(r) a
|
|
real, intent(in) :: a(2)
|
|
end
|
|
|
|
subroutine t5(m)
|
|
!dir$ ignore_tkr(r) m
|
|
real, intent(in) :: m(2,2)
|
|
end
|
|
|
|
subroutine t6(x)
|
|
!dir$ ignore_tkr(a) x
|
|
real, intent(in) :: x
|
|
end
|
|
|
|
subroutine t7(x)
|
|
!ERROR: !DIR$ IGNORE_TKR directive may not have an empty parenthesized list of letters
|
|
!dir$ ignore_tkr() x
|
|
real, intent(in) :: x
|
|
end
|
|
|
|
subroutine t8(x)
|
|
!dir$ ignore_tkr x
|
|
real, intent(in) :: x
|
|
end
|
|
|
|
subroutine t9(x)
|
|
!dir$ ignore_tkr x
|
|
!WARNING: !DIR$ IGNORE_TKR should not apply to an allocatable or pointer [-Wignore-tkr-usage]
|
|
real, intent(in), allocatable :: x
|
|
end
|
|
|
|
subroutine t10(x)
|
|
!dir$ ignore_tkr x
|
|
!WARNING: !DIR$ IGNORE_TKR should not apply to an allocatable or pointer [-Wignore-tkr-usage]
|
|
real, intent(in), pointer :: x
|
|
end
|
|
|
|
subroutine t11
|
|
!dir$ ignore_tkr x
|
|
!ERROR: !DIR$ IGNORE_TKR directive may apply only to a dummy data argument
|
|
real :: x
|
|
end
|
|
|
|
subroutine t12(p,q,r)
|
|
!dir$ ignore_tkr p, q
|
|
!ERROR: 'p' is a data object and may not be EXTERNAL
|
|
real, external :: p
|
|
!ERROR: 'q' is already declared as an object
|
|
procedure(real) :: q
|
|
procedure(), pointer :: r
|
|
!ERROR: 'r' must be an object
|
|
!dir$ ignore_tkr r
|
|
end
|
|
|
|
elemental subroutine t13(x)
|
|
!dir$ ignore_tkr(r) x
|
|
!ERROR: !DIR$ IGNORE_TKR(R) may not apply in an ELEMENTAL procedure
|
|
real, intent(in) :: x
|
|
end
|
|
|
|
subroutine t14(x)
|
|
!dir$ ignore_tkr(r) x
|
|
!WARNING: !DIR$ IGNORE_TKR(R) should not apply to a dummy argument passed via descriptor [-Wignore-tkr-usage]
|
|
real x(:)
|
|
end
|
|
|
|
module subroutine t24(x)
|
|
!dir$ ignore_tkr(t) x
|
|
real x(:)
|
|
end
|
|
|
|
end interface
|
|
|
|
contains
|
|
subroutine t15(x)
|
|
!dir$ ignore_tkr x
|
|
!ERROR: !DIR$ IGNORE_TKR may not apply to an allocatable or pointer
|
|
real, intent(in), allocatable :: x
|
|
end
|
|
|
|
subroutine t16(x)
|
|
!dir$ ignore_tkr x
|
|
!ERROR: !DIR$ IGNORE_TKR may not apply to an allocatable or pointer
|
|
real, intent(in), pointer :: x
|
|
end
|
|
|
|
subroutine t17(x)
|
|
real x
|
|
x = x + 1.
|
|
!WARNING: !DIR$ IGNORE_TKR directive should appear in the specification part [-Wmisplaced-ignore-tkr]
|
|
!dir$ ignore_tkr x
|
|
end
|
|
|
|
subroutine t18(x)
|
|
!ERROR: 'q' is not a valid letter for !DIR$ IGNORE_TKR directive
|
|
!dir$ ignore_tkr(q) x
|
|
real x
|
|
x = x + 1.
|
|
end
|
|
|
|
subroutine t19(x)
|
|
real x
|
|
contains
|
|
subroutine inner
|
|
!ERROR: 'x' must be local to this subprogram
|
|
!dir$ ignore_tkr x
|
|
end
|
|
end
|
|
|
|
subroutine t20(x)
|
|
real x
|
|
block
|
|
!ERROR: 'x' must be local to this subprogram
|
|
!dir$ ignore_tkr x
|
|
end block
|
|
end
|
|
|
|
subroutine t22(x)
|
|
!dir$ ignore_tkr(r) x
|
|
!WARNING: !DIR$ IGNORE_TKR(R) is not meaningful for an assumed-rank array [-Wignore-tkr-usage]
|
|
real x(..)
|
|
end
|
|
|
|
subroutine t23(x)
|
|
!dir$ ignore_tkr(r) x
|
|
!ERROR: !DIR$ IGNORE_TKR(R) may not apply to a dummy argument passed via descriptor
|
|
real x(:)
|
|
end
|
|
|
|
end
|
|
|
|
subroutine bad1(x)
|
|
!dir$ ignore_tkr x
|
|
!ERROR: !DIR$ IGNORE_TKR may apply only in an interface or a module procedure
|
|
real, intent(in) :: x
|
|
end
|
|
|
|
submodule(m) subm
|
|
contains
|
|
module subroutine t24(x)
|
|
!dir$ ignore_tkr(t) x
|
|
real x(:)
|
|
end
|
|
end
|
|
|
|
program test
|
|
|
|
!WARNING: !DIR$ IGNORE_TKR directive should appear in a subroutine or function [-Wmisplaced-ignore-tkr]
|
|
!dir$ ignore_tkr
|
|
|
|
use m
|
|
real x
|
|
real a(2)
|
|
real m(2,2)
|
|
double precision dx
|
|
|
|
call t1(1)
|
|
call t1(dx)
|
|
call t1('a')
|
|
call t1((1.,2.))
|
|
call t1(.true.)
|
|
|
|
call t2(1)
|
|
!ERROR: Actual argument type 'REAL(8)' is not compatible with dummy argument type 'REAL(4)'
|
|
call t2(dx)
|
|
call t2('a')
|
|
call t2((1.,2.))
|
|
call t2(.true.)
|
|
|
|
!ERROR: Actual argument type 'INTEGER(4)' is not compatible with dummy argument type 'REAL(4)'
|
|
call t3(1)
|
|
call t3(dx)
|
|
!ERROR: passing Hollerith or character literal as if it were BOZ [-Whollerith-or-character-as-boz]
|
|
call t3('a')
|
|
!ERROR: Actual argument type 'COMPLEX(4)' is not compatible with dummy argument type 'REAL(4)'
|
|
call t3((1.,2.))
|
|
!ERROR: Actual argument type 'LOGICAL(4)' is not compatible with dummy argument type 'REAL(4)'
|
|
call t3(.true.)
|
|
|
|
call t4(x)
|
|
call t4(m)
|
|
call t5(x)
|
|
!WARNING: Actual argument array has fewer elements (2) than dummy argument 'm=' array (4)
|
|
call t5(a)
|
|
|
|
call t6(1)
|
|
call t6(dx)
|
|
call t6('a')
|
|
call t6((1.,2.))
|
|
call t6(.true.)
|
|
call t6(a)
|
|
|
|
call t8(1)
|
|
call t8(dx)
|
|
call t8('a')
|
|
call t8((1.,2.))
|
|
call t8(.true.)
|
|
call t8(a)
|
|
|
|
contains
|
|
subroutine inner(x)
|
|
!dir$ ignore_tkr x
|
|
!ERROR: !DIR$ IGNORE_TKR may apply only in an interface or a module procedure
|
|
real, intent(in) :: x
|
|
end
|
|
end
|