[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenMP / omp-atomic.f90
blob44f06b7460bf10d48c9fbcb161f76ece678ce8ec
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenmp
2 use omp_lib
3 ! Check OpenMP 2.13.6 atomic Construct
5 a = 1.0
6 !$omp parallel num_threads(4)
7 !$omp atomic seq_cst, read
8 b = a
10 !$omp atomic seq_cst write
11 a = b
12 !$omp end atomic
14 !$omp atomic read acquire hint(OMP_LOCK_HINT_CONTENDED)
15 a = b
17 !$omp atomic release hint(OMP_LOCK_HINT_UNCONTENDED) write
18 a = b
20 !$omp atomic capture seq_cst
21 b = a
22 a = a + 1
23 !$omp end atomic
25 !$omp atomic hint(1) acq_rel capture
26 b = a
27 a = a + 1
28 !$omp end atomic
30 !ERROR: expected end of line
31 !$omp atomic read write
32 a = a + 1
34 !$omp atomic
35 a = a + 1
36 !ERROR: expected 'UPDATE'
37 !ERROR: expected 'WRITE'
38 !ERROR: expected 'CAPTURE'
39 !ERROR: expected 'READ'
40 !$omp atomic num_threads(4)
41 a = a + 1
43 !ERROR: expected end of line
44 !$omp atomic capture num_threads(4)
45 a = a + 1
47 !$omp atomic relaxed
48 a = a + 1
50 !ERROR: expected 'UPDATE'
51 !ERROR: expected 'WRITE'
52 !ERROR: expected 'CAPTURE'
53 !ERROR: expected 'READ'
54 !$omp atomic num_threads write
55 a = a + 1
57 !$omp end parallel
58 end