Files
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

250 lines
5.7 KiB
Fortran

! RUN: %python %S/../test_errors.py %s %flang -fopenmp
! OpenMP Version 5.0
! Check OpenMP construct validity for the following directives:
! 2.18.1 Cancel Construct
program main
integer :: i, N = 10
real :: a
!ERROR: CANCEL TASKGROUP directive is not closely nested inside TASK or TASKLOOP
!$omp cancel taskgroup
!ERROR: CANCEL SECTIONS directive is not closely nested inside SECTION or SECTIONS
!$omp cancel sections
!ERROR: CANCEL DO directive is not closely nested inside the construct that matches the DO clause type
!$omp cancel do
!ERROR: CANCEL PARALLEL directive is not closely nested inside the construct that matches the PARALLEL clause type
!$omp cancel parallel
!$omp parallel
!$omp sections
!$omp cancel sections
!$omp section
a = 3.14
!$omp end sections
!$omp end parallel
!$omp sections
!$omp section
!$omp cancel sections
a = 3.14
!$omp end sections
!$omp parallel
!ERROR: With SECTIONS clause, CANCEL construct cannot be closely nested inside PARALLEL construct
!$omp cancel sections
a = 3.14
!$omp end parallel
!$omp parallel sections
!$omp cancel sections
a = 3.14
!$omp end parallel sections
!$omp do
do i = 1, N
a = 3.14
!$omp cancel do
end do
!$omp end do
!$omp parallel do
do i = 1, N
a = 3.14
!$omp cancel do
end do
!$omp end parallel do
!$omp target
!$omp teams
!$omp distribute parallel do
do i = 1, N
a = 3.14
!$omp cancel do
end do
!$omp end distribute parallel do
!$omp end teams
!$omp end target
!$omp target
!$omp teams distribute parallel do
do i = 1, N
a = 3.14
!$omp cancel do
end do
!$omp end teams distribute parallel do
!$omp end target
!$omp target teams distribute parallel do
do i = 1, N
a = 3.14
!$omp cancel do
end do
!$omp end target teams distribute parallel do
!$omp target parallel do
do i = 1, N
a = 3.14
!$omp cancel do
end do
!$omp end target parallel do
!$omp parallel
do i = 1, N
a = 3.14
!ERROR: With DO clause, CANCEL construct cannot be closely nested inside PARALLEL construct
!$omp cancel do
end do
!$omp end parallel
!$omp parallel
do i = 1, N
a = 3.14
!$omp cancel parallel
end do
!$omp end parallel
!$omp target parallel
do i = 1, N
a = 3.14
!$omp cancel parallel
end do
!$omp end target parallel
!$omp target parallel do
do i = 1, N
a = 3.14
!ERROR: With PARALLEL clause, CANCEL construct cannot be closely nested inside TARGET PARALLEL DO construct
!$omp cancel parallel
end do
!$omp end target parallel do
!$omp do
do i = 1, N
a = 3.14
!ERROR: With PARALLEL clause, CANCEL construct cannot be closely nested inside DO construct
!$omp cancel parallel
end do
!$omp end do
contains
subroutine sub1()
!$omp task
!$omp cancel taskgroup
a = 3.14
!$omp end task
!$omp taskloop
do i = 1, N
!$omp parallel
!$omp end parallel
!$omp cancel taskgroup
a = 3.14
end do
!$omp end taskloop
!$omp taskloop nogroup
do i = 1, N
!$omp cancel taskgroup
a = 3.14
end do
!$omp parallel
!ERROR: With TASKGROUP clause, CANCEL construct must be closely nested inside TASK or TASKLOOP construct and CANCEL region must be closely nested inside TASKGROUP region
!$omp cancel taskgroup
a = 3.14
!$omp end parallel
!$omp do
do i = 1, N
!$omp task
!$omp cancel taskgroup
a = 3.14
!$omp end task
end do
!$omp end do
!$omp parallel
!$omp taskgroup
!$omp task
!$omp cancel taskgroup
a = 3.14
!$omp end task
!$omp end taskgroup
!$omp end parallel
!$omp parallel
!$omp task
!ERROR: With TASKGROUP clause, CANCEL construct must be closely nested inside TASK or TASKLOOP construct and CANCEL region must be closely nested inside TASKGROUP region
!$omp cancel taskgroup
a = 3.14
!$omp end task
!$omp end parallel
!$omp parallel
!$omp do
do i = 1, N
!$omp task
!ERROR: With TASKGROUP clause, CANCEL construct must be closely nested inside TASK or TASKLOOP construct and CANCEL region must be closely nested inside TASKGROUP region
!$omp cancel taskgroup
a = 3.14
!$omp end task
end do
!$omp end do
!$omp end parallel
!$omp target parallel
!$omp task
!ERROR: With TASKGROUP clause, CANCEL construct must be closely nested inside TASK or TASKLOOP construct and CANCEL region must be closely nested inside TASKGROUP region
!$omp cancel taskgroup
a = 3.14
!$omp end task
!$omp end target parallel
!$omp parallel
!$omp taskloop private(j) nogroup
do i = 1, N
!ERROR: With TASKGROUP clause, CANCEL construct must be closely nested inside TASK or TASKLOOP construct and CANCEL region must be closely nested inside TASKGROUP region
!$omp cancel taskgroup
a = 3.14
end do
!$omp end taskloop
!$omp end parallel
!$omp parallel
!$omp taskloop
do i = 1, N
!$omp cancel taskgroup
a = 3.14
end do
!$omp end taskloop
!$omp end parallel
!$omp parallel
!$omp taskgroup
!$omp taskloop nogroup
do i = 1, N
!$omp cancel taskgroup
a = 3.14
end do
!$omp end taskloop
!$omp end taskgroup
!$omp end parallel
!$omp target parallel
!$omp taskloop nogroup
do i = 1, N
!ERROR: With TASKGROUP clause, CANCEL construct must be closely nested inside TASK or TASKLOOP construct and CANCEL region must be closely nested inside TASKGROUP region
!$omp cancel taskgroup
a = 3.14
end do
!$omp end taskloop
!$omp end target parallel
end subroutine sub1
end program main