| 1 |
! REQUIRES: openmp_runtime |
| 2 |
|
| 3 |
! RUN: %python %S/../test_errors.py %s %flang %openmp_flags |
| 4 |
|
| 5 |
! OpenMP Version 5.0 |
| 6 |
! 2.17.1 critical construct |
| 7 |
! If the hint clause is specified, the critical construct must have a name. |
| 8 |
program sample |
| 9 |
use omp_lib |
| 10 |
integer i, j |
| 11 |
!ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive |
| 12 |
!$omp critical hint(omp_lock_hint_speculative) |
| 13 |
j = j + 1 |
| 14 |
!$omp end critical |
| 15 |
|
| 16 |
!$omp critical (foo) hint(omp_lock_hint_speculative) |
| 17 |
i = i - 1 |
| 18 |
!$omp end critical (foo) |
| 19 |
|
| 20 |
!ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive |
| 21 |
!$omp critical hint(omp_lock_hint_nonspeculative) |
| 22 |
j = j + 1 |
| 23 |
!$omp end critical |
| 24 |
|
| 25 |
!$omp critical (foo) hint(omp_lock_hint_nonspeculative) |
| 26 |
i = i - 1 |
| 27 |
!$omp end critical (foo) |
| 28 |
|
| 29 |
!ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive |
| 30 |
!$omp critical hint(omp_lock_hint_contended) |
| 31 |
j = j + 1 |
| 32 |
!$omp end critical |
| 33 |
|
| 34 |
!$omp critical (foo) hint(omp_lock_hint_contended) |
| 35 |
i = i - 1 |
| 36 |
!$omp end critical (foo) |
| 37 |
|
| 38 |
!ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive |
| 39 |
!$omp critical hint(omp_lock_hint_uncontended) |
| 40 |
j = j + 1 |
| 41 |
!$omp end critical |
| 42 |
|
| 43 |
!$omp critical (foo) hint(omp_lock_hint_uncontended) |
| 44 |
i = i - 1 |
| 45 |
!$omp end critical (foo) |
| 46 |
|
| 47 |
!$omp critical hint(omp_sync_hint_none) |
| 48 |
j = j + 1 |
| 49 |
!$omp end critical |
| 50 |
|
| 51 |
!$omp critical (foo) hint(omp_sync_hint_none) |
| 52 |
i = i - 1 |
| 53 |
!$omp end critical (foo) |
| 54 |
|
| 55 |
end program sample |