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

90 lines
2.6 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Tests for F'2023 C1131:
! A variable-name that appears in a REDUCE locality-spec shall not have the
! ASYNCHRONOUS, INTENT (IN), OPTIONAL, or VOLATILE attribute, shall not be
! coindexed, and shall not be an assumed-size array. A variable-name that is not
! permitted to appear in a variable definition context shall not appear in a
! REDUCE locality-spec.
subroutine s1()
! Cannot have ASYNCHRONOUS variable in a REDUCE locality spec
integer, asynchronous :: k
!ERROR: ASYNCHRONOUS variable 'k' not allowed in a REDUCE locality-spec
do concurrent(i=1:5) reduce(+:k)
k = k + i
end do
end subroutine s1
subroutine s2(arg)
! Cannot have a dummy OPTIONAL in a REDUCE locality spec
integer, optional :: arg
!ERROR: OPTIONAL argument 'arg' not allowed in a locality-spec
do concurrent(i=1:5) reduce(*:arg)
arg = arg * 1
end do
end subroutine s2
subroutine s3(arg)
! This is OK
real :: arg
integer :: reduce, reduce2, reduce3
do concurrent(i=1:5) reduce(max:arg,reduce) reduce(iand:reduce2,reduce3)
arg = max(arg, i)
reduce = max(reduce, i)
reduce3 = iand(reduce3, i)
end do
end subroutine s3
subroutine s4(arg)
! Cannot have a dummy INTENT(IN) in a REDUCE locality spec
real, intent(in) :: arg
!ERROR: INTENT IN argument 'arg' not allowed in a locality-spec
do concurrent(i=1:5) reduce(min:arg)
!ERROR: Left-hand side of assignment is not definable
!ERROR: 'arg' is an INTENT(IN) dummy argument
arg = min(arg, i)
end do
end subroutine s4
module m
contains
subroutine s5()
! Cannot have VOLATILE variable in a REDUCE locality spec
integer, volatile :: var
!ERROR: VOLATILE variable 'var' not allowed in a REDUCE locality-spec
do concurrent(i=1:5) reduce(ieor:var)
var = ieor(var, i)
end do
end subroutine s5
subroutine f(x)
integer :: x
end subroutine f
end module m
subroutine s8(arg)
! Cannot have an assumed size array
integer, dimension(*) :: arg
!ERROR: Assumed size array 'arg' not allowed in a locality-spec
do concurrent(i=1:5) reduce(ior:arg)
arg(i) = ior(arg(i), i)
end do
end subroutine s8
subroutine s9()
! Reduction variable should not appear in a variable definition context
integer :: i
!ERROR: 'i' is already declared in this scoping unit
do concurrent(i=1:5) reduce(+:i)
end do
end subroutine s9
subroutine s10()
! Cannot have variable inside of a NAMELIST in a REDUCE locality spec
integer :: k
namelist /nlist1/ k
!ERROR: NAMELIST variable 'k' not allowed in a REDUCE locality-spec
do concurrent(i=1:5) reduce(+:k)
k = k + i
end do
end subroutine s10