1! RUN: %S/test_errors.sh %s %t %flang -fopenmp
2! REQUIRES: shell
3use omp_lib
4! Check OpenMP 2.13.6 atomic Construct
5
6  a = 1.0
7  !$omp parallel num_threads(4)
8  !$omp atomic seq_cst, read
9  b = a
10
11  !$omp atomic seq_cst write
12  a = b
13  !$omp end atomic
14
15  !$omp atomic read acquire hint(OMP_LOCK_HINT_CONTENDED)
16  a = b
17
18  !$omp atomic release hint(OMP_LOCK_HINT_UNCONTENDED) write
19  a = b
20
21  !$omp atomic capture seq_cst
22  b = a
23  a = a + 1
24  !$omp end atomic
25
26  !$omp atomic hint(1) acq_rel capture
27  b = a
28  a = a + 1
29  !$omp end atomic
30
31  !ERROR: expected end of line
32  !$omp atomic read write
33  a = a + 1
34
35  !$omp atomic
36  a = a + 1
37  !ERROR: expected 'UPDATE'
38  !ERROR: expected 'WRITE'
39  !ERROR: expected 'CAPTURE'
40  !ERROR: expected 'READ'
41  !$omp atomic num_threads(4)
42  a = a + 1
43
44  !ERROR: expected end of line
45  !$omp atomic capture num_threads(4)
46  a = a + 1
47
48  !$omp atomic relaxed
49  a = a + 1
50
51  !ERROR: expected 'UPDATE'
52  !ERROR: expected 'WRITE'
53  !ERROR: expected 'CAPTURE'
54  !ERROR: expected 'READ'
55  !$omp atomic num_threads write
56  a = a + 1
57
58  !$omp end parallel
59end
60