30 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %python %S/../test_errors.py %s %flang %openmp_flags -fopenmp-version=504 5! This tests the various semantics related to the clauses of various OpenMP atomic constructs6 7program OmpAtomic8 use omp_lib9 integer :: g, x10 11 !ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct12 !$omp atomic relaxed, seq_cst13 x = x + 114 !ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct15 !$omp atomic read seq_cst, relaxed16 x = g17 !ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct18 !$omp atomic write relaxed, release19 x = 2 * 420 !ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct21 !$omp atomic update release, seq_cst22 !ERROR: This is not a valid ATOMIC UPDATE operation23 x = 1024 !ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct25 !$omp atomic capture release, seq_cst26 x = g27 g = x * 1028 !$omp end atomic29end program OmpAtomic30