Debian Codegraph @

flang/test/Semantics/OpenMP/atomic05.f90

raw
1 ! REQUIRES: openmp_runtime
2
3 ! RUN: %python %S/../test_errors.py %s %flang %openmp_flags
4
5 ! This tests the various semantics related to the clauses of various OpenMP atomic constructs
6
7 program OmpAtomic
8 use omp_lib
9 integer :: g, x
10
11 !ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
12 !$omp atomic relaxed, seq_cst
13 x = x + 1
14 !ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
15 !$omp atomic read seq_cst, relaxed
16 x = g
17 !ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
18 !$omp atomic write relaxed, release
19 x = 2 * 4
20 !ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
21 !$omp atomic update release, seq_cst
22 !ERROR: Invalid or missing operator in atomic update statement
23 x = 10
24 !ERROR: More than one memory order clause not allowed on OpenMP Atomic construct
25 !$omp atomic capture release, seq_cst
26 x = g
27 g = x * 10
28 !$omp end atomic
29 end program OmpAtomic