[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-atomic.f90
blob6fc500ca3fd8edc92bee7ee6de31b6bf9835b748
1 ! RUN: %S/test_errors.sh %s %t %flang -fopenmp
2 ! REQUIRES: shell
3 use omp_lib
4 ! Check OpenMP 2.13.6 atomic Construct
6 a = 1.0
7 !$omp parallel num_threads(4)
8 !$omp atomic seq_cst, read
9 b = a
11 !$omp atomic seq_cst write
12 a = b
13 !$omp end atomic
15 !$omp atomic read acquire hint(OMP_LOCK_HINT_CONTENDED)
16 a = b
18 !$omp atomic release hint(OMP_LOCK_HINT_UNCONTENDED) write
19 a = b
21 !$omp atomic capture seq_cst
22 b = a
23 a = a + 1
24 !$omp end atomic
26 !$omp atomic hint(1) acq_rel capture
27 b = a
28 a = a + 1
29 !$omp end atomic
31 !ERROR: expected end of line
32 !$omp atomic read write
33 a = a + 1
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
44 !ERROR: expected end of line
45 !$omp atomic capture num_threads(4)
46 a = a + 1
48 !$omp atomic relaxed
49 a = a + 1
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
58 !$omp end parallel
59 end