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
88 lines
2.6 KiB
Fortran
88 lines
2.6 KiB
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
|
|
! Tests ELEMENTAL subprogram constraints C15100-15102
|
|
|
|
!ERROR: An ELEMENTAL subroutine may not have an alternate return dummy argument
|
|
elemental subroutine altret(*)
|
|
end subroutine
|
|
|
|
elemental subroutine arrarg(a)
|
|
!ERROR: A dummy argument of an ELEMENTAL procedure must be scalar
|
|
real, intent(in) :: a(1)
|
|
end subroutine
|
|
|
|
elemental subroutine alloarg(a)
|
|
!ERROR: A dummy argument of an ELEMENTAL procedure may not be ALLOCATABLE
|
|
real, intent(in), allocatable :: a
|
|
end subroutine
|
|
|
|
elemental subroutine coarg(a)
|
|
!ERROR: A dummy argument of an ELEMENTAL procedure may not be a coarray
|
|
real, intent(in) :: a[*]
|
|
end subroutine
|
|
|
|
elemental subroutine ptrarg(a)
|
|
!ERROR: A dummy argument of an ELEMENTAL procedure may not be a POINTER
|
|
real, intent(in), pointer :: a
|
|
end subroutine
|
|
|
|
impure elemental subroutine barearg(a)
|
|
!ERROR: A dummy argument of an ELEMENTAL procedure must have an INTENT() or VALUE attribute
|
|
real :: a
|
|
end subroutine
|
|
|
|
elemental function arrf(n)
|
|
integer, value :: n
|
|
!ERROR: The result of an ELEMENTAL function must be scalar
|
|
real :: arrf(n)
|
|
end function
|
|
|
|
elemental function allof(n)
|
|
integer, value :: n
|
|
!ERROR: The result of an ELEMENTAL function may not be ALLOCATABLE
|
|
real, allocatable :: allof
|
|
end function
|
|
|
|
elemental function ptrf(n)
|
|
integer, value :: n
|
|
!ERROR: The result of an ELEMENTAL function may not be a POINTER
|
|
real, pointer :: ptrf
|
|
end function
|
|
|
|
module m
|
|
integer modvar
|
|
type t
|
|
character(:), allocatable :: c
|
|
end type
|
|
type pdt(L)
|
|
integer, len :: L
|
|
end type
|
|
type container
|
|
class(pdt(:)), allocatable :: c
|
|
end type
|
|
contains
|
|
!ERROR: Invalid specification expression for elemental function result: dependence on value of dummy argument 'n'
|
|
elemental character(n) function bad1(n)
|
|
integer, intent(in) :: n
|
|
end
|
|
!ERROR: Invalid specification expression for elemental function result: non-constant inquiry function 'len' not allowed for local object
|
|
elemental character(x%c%len) function bad2(x)
|
|
type(t), intent(in) :: x
|
|
end
|
|
!ERROR: Invalid specification expression for elemental function result: non-constant type parameter inquiry not allowed for local object
|
|
elemental character(x%c%L) function bad3(x)
|
|
class(container), intent(in) :: x
|
|
end
|
|
elemental character(len(x)) function ok1(x) ! ok
|
|
character(*), intent(in) :: x
|
|
end
|
|
elemental character(modvar) function ok2(x) ! ok
|
|
character(*), intent(in) :: x
|
|
end
|
|
elemental character(len(x)) function ok3(x) ! ok
|
|
character(modvar), intent(in) :: x
|
|
end
|
|
elemental character(storage_size(x)) function ok4(x) ! ok
|
|
class(*), intent(in) :: x
|
|
end
|
|
end
|