[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Semantics / OpenMP / sync-critical02.f90
blob1fa9d6ad84f28c6ea7924659495f4f1ba4bad4b8
1 ! REQUIRES: openmp_runtime
3 ! RUN: %python %S/../test_errors.py %s %flang %openmp_flags
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
16 !$omp critical (foo) hint(omp_lock_hint_speculative)
17 i = i - 1
18 !$omp end critical (foo)
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
25 !$omp critical (foo) hint(omp_lock_hint_nonspeculative)
26 i = i - 1
27 !$omp end critical (foo)
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
34 !$omp critical (foo) hint(omp_lock_hint_contended)
35 i = i - 1
36 !$omp end critical (foo)
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
43 !$omp critical (foo) hint(omp_lock_hint_uncontended)
44 i = i - 1
45 !$omp end critical (foo)
47 !$omp critical hint(omp_sync_hint_none)
48 j = j + 1
49 !$omp end critical
51 !$omp critical (foo) hint(omp_sync_hint_none)
52 i = i - 1
53 !$omp end critical (foo)
55 end program sample