This PR changes the build system to use use the sources for the module `omp_lib` and the `omp_lib.h` include file from the `openmp` runtime project and not from a separate copy of these files. This will greatly reduce potential for inconsistencies when adding features to the OpenMP runtime implementation. When the OpenMP subproject is not configured, this PR also disables the corresponding LIT tests with a "REQUIRES" directive at the beginning of the OpenMP test files. --------- Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>
30 lines
1.0 KiB
Fortran
30 lines
1.0 KiB
Fortran
! REQUIRES: openmp_runtime
|
|
|
|
! RUN: %python %S/../test_errors.py %s %flang -fopenmp
|
|
|
|
! This tests the various semantics related to the clauses of various OpenMP atomic constructs
|
|
|
|
program OmpAtomic
|
|
use omp_lib
|
|
integer :: g, x
|
|
|
|
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
|
|
!$omp atomic relaxed, seq_cst
|
|
x = x + 1
|
|
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
|
|
!$omp atomic read seq_cst, relaxed
|
|
x = g
|
|
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
|
|
!$omp atomic write relaxed, release
|
|
x = 2 * 4
|
|
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
|
|
!$omp atomic update release, seq_cst
|
|
!ERROR: Invalid or missing operator in atomic update statement
|
|
x = 10
|
|
!ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
|
|
!$omp atomic capture release, seq_cst
|
|
x = g
|
|
g = x * 10
|
|
!$omp end atomic
|
|
end program OmpAtomic
|