| 1 |
! RUN: %python %S/../test_errors.py %s %flang -fopenmp |
| 2 |
use omp_lib |
| 3 |
! Check OpenMP 2.13.6 atomic Construct |
| 4 |
|
| 5 |
a = 1.0 |
| 6 |
!$omp parallel num_threads(4) |
| 7 |
!$omp atomic seq_cst, read |
| 8 |
b = a |
| 9 |
|
| 10 |
!$omp atomic seq_cst write |
| 11 |
a = b |
| 12 |
!$omp end atomic |
| 13 |
|
| 14 |
!$omp atomic read acquire hint(OMP_LOCK_HINT_CONTENDED) |
| 15 |
a = b |
| 16 |
|
| 17 |
!$omp atomic release hint(OMP_LOCK_HINT_UNCONTENDED) write |
| 18 |
a = b |
| 19 |
|
| 20 |
!$omp atomic capture seq_cst |
| 21 |
b = a |
| 22 |
a = a + 1 |
| 23 |
!$omp end atomic |
| 24 |
|
| 25 |
!$omp atomic hint(1) acq_rel capture |
| 26 |
b = a |
| 27 |
a = a + 1 |
| 28 |
!$omp end atomic |
| 29 |
|
| 30 |
!ERROR: expected end of line |
| 31 |
!$omp atomic read write |
| 32 |
a = a + 1 |
| 33 |
|
| 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 |
| 42 |
|
| 43 |
!ERROR: expected end of line |
| 44 |
!$omp atomic capture num_threads(4) |
| 45 |
a = a + 1 |
| 46 |
|
| 47 |
!$omp atomic relaxed |
| 48 |
a = a + 1 |
| 49 |
|
| 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 |
| 56 |
|
| 57 |
!$omp end parallel |
| 58 |
end |