Files
TheRock/compiler/amd-llvm/flang/test/Integration/OpenMP/atomic-capture-release.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

46 lines
2.0 KiB
Fortran

!===----------------------------------------------------------------------===!
! This directory can be used to add Integration tests involving multiple
! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
! contain executable tests. We should only add tests here sparingly and only
! if there is no other way to test. Repeat this message in each test that is
! added to this directory and sub-directories.
!===----------------------------------------------------------------------===!
!RUN: %if x86-registered-target %{ %flang_fc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fopenmp -fopenmp-version=51 %s -o - | FileCheck %s %}
!RUN: %if aarch64-registered-target %{ %flang_fc1 -triple aarch64-unknown-linux-gnu -emit-llvm -fopenmp -fopenmp-version=51 %s -o - | FileCheck %s %}
! Real(4) capture with release ordering: the initial load in the cmpxchg loop
! must use monotonic (not release, which is invalid for loads in LLVM IR).
!CHECK: define void {{.*}}test_capture_release_(
!CHECK-SAME: ptr noalias %[[A:.*]], ptr noalias %[[B:.*]], ptr noalias %[[C:.*]])
!CHECK: [[ENTRY:.*]]:
!CHECK: [[ATOMIC_LOAD:.*]] = load atomic i32, ptr %[[A]] monotonic, align 4
!CHECK: [[CONT:.*]]:
!CHECK: cmpxchg ptr %[[A]], i32 %{{.*}}, i32 %{{.*}} release monotonic
!CHECK: [[EXIT:.*]]:
!CHECK: call void {{.*}}__kmpc_flush{{.*}}
!CHECK: ret
subroutine test_capture_release(a,b,c)
real(4) :: a, b, c
!$omp atomic capture release
c = a
a = a + b
!$omp end atomic
end subroutine
! Integer(4) capture with acq_rel ordering: uses atomicrmw (valid with acq_rel).
!CHECK: define void {{.*}}test_capture_acq_rel_(
!CHECK-SAME: ptr noalias %[[A:.*]], ptr noalias %[[B:.*]], ptr noalias %[[C:.*]])
!CHECK: %[[TMP1:.*]] = load {{.*}}, ptr %[[B]]
!CHECK: [[ENTRY:.*]]:
!CHECK: %[[TMP2:.*]] = atomicrmw add ptr %[[A]], i32 %[[TMP1]] acq_rel
!CHECK: call void {{.*}}__kmpc_flush{{.*}}
!CHECK: ret
subroutine test_capture_acq_rel(a,b,c)
integer(4) :: a, b, c
!$omp atomic capture acq_rel
c = a
a = a + b
!$omp end atomic
end subroutine