This PR changes the build system to use use the sources for the module `omp_lib` and the `omp_lib.h` include file from the `openmp` runtime project and not from a separate copy of these files. This will greatly reduce potential for inconsistencies when adding features to the OpenMP runtime implementation. When the OpenMP subproject is not configured, this PR also disables the corresponding LIT tests with a "REQUIRES" directive at the beginning of the OpenMP test files. --------- Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>
56 lines
1.6 KiB
Fortran
56 lines
1.6 KiB
Fortran
! REQUIRES: openmp_runtime
|
|
|
|
! RUN: %python %S/../test_errors.py %s %flang -fopenmp
|
|
|
|
! OpenMP Version 5.0
|
|
! 2.17.1 critical construct
|
|
! If the hint clause is specified, the critical construct must have a name.
|
|
program sample
|
|
use omp_lib
|
|
integer i, j
|
|
!ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive
|
|
!$omp critical hint(omp_lock_hint_speculative)
|
|
j = j + 1
|
|
!$omp end critical
|
|
|
|
!$omp critical (foo) hint(omp_lock_hint_speculative)
|
|
i = i - 1
|
|
!$omp end critical (foo)
|
|
|
|
!ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive
|
|
!$omp critical hint(omp_lock_hint_nonspeculative)
|
|
j = j + 1
|
|
!$omp end critical
|
|
|
|
!$omp critical (foo) hint(omp_lock_hint_nonspeculative)
|
|
i = i - 1
|
|
!$omp end critical (foo)
|
|
|
|
!ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive
|
|
!$omp critical hint(omp_lock_hint_contended)
|
|
j = j + 1
|
|
!$omp end critical
|
|
|
|
!$omp critical (foo) hint(omp_lock_hint_contended)
|
|
i = i - 1
|
|
!$omp end critical (foo)
|
|
|
|
!ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive
|
|
!$omp critical hint(omp_lock_hint_uncontended)
|
|
j = j + 1
|
|
!$omp end critical
|
|
|
|
!$omp critical (foo) hint(omp_lock_hint_uncontended)
|
|
i = i - 1
|
|
!$omp end critical (foo)
|
|
|
|
!$omp critical hint(omp_sync_hint_none)
|
|
j = j + 1
|
|
!$omp end critical
|
|
|
|
!$omp critical (foo) hint(omp_sync_hint_none)
|
|
i = i - 1
|
|
!$omp end critical (foo)
|
|
|
|
end program sample
|