Make the OperationCode overloads take the derived operation instead of the Operation base class instance. This makes them usable from visitors of "Expr<T>.u". Also, fix small bug: OperationCode(Constant<T>) shoud be "Constant".
30 lines
1.1 KiB
Fortran
30 lines
1.1 KiB
Fortran
! REQUIRES: openmp_runtime
|
|
|
|
! RUN: %python %S/../test_errors.py %s %flang %openmp_flags -fopenmp-version=50
|
|
|
|
! This tests the various semantics related to the clauses of various OpenMP atomic constructs
|
|
|
|
program OmpAtomic
|
|
use omp_lib
|
|
integer :: g, x
|
|
|
|
!ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct
|
|
!$omp atomic relaxed, seq_cst
|
|
x = x + 1
|
|
!ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct
|
|
!$omp atomic read seq_cst, relaxed
|
|
x = g
|
|
!ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct
|
|
!$omp atomic write relaxed, release
|
|
x = 2 * 4
|
|
!ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct
|
|
!$omp atomic update release, seq_cst
|
|
!ERROR: This is not a valid ATOMIC UPDATE operation
|
|
x = 10
|
|
!ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct
|
|
!$omp atomic capture release, seq_cst
|
|
x = g
|
|
g = x * 10
|
|
!$omp end atomic
|
|
end program OmpAtomic
|