[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenMP / omp-sync-critical02.f90
blobdac031f4f8fc36f2585ebd5f34ef0183565689e6
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenmp
3 ! OpenMP Version 5.0
4 ! 2.17.1 critical construct
5 ! If the hint clause is specified, the critical construct must have a name.
6 program sample
7 use omp_lib
8 integer i, j
9 !ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive
10 !$omp critical hint(omp_lock_hint_speculative)
11 j = j + 1
12 !$omp end critical
14 !$omp critical (foo) hint(omp_lock_hint_speculative)
15 i = i - 1
16 !$omp end critical (foo)
18 !ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive
19 !$omp critical hint(omp_lock_hint_nonspeculative)
20 j = j + 1
21 !$omp end critical
23 !$omp critical (foo) hint(omp_lock_hint_nonspeculative)
24 i = i - 1
25 !$omp end critical (foo)
27 !ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive
28 !$omp critical hint(omp_lock_hint_contended)
29 j = j + 1
30 !$omp end critical
32 !$omp critical (foo) hint(omp_lock_hint_contended)
33 i = i - 1
34 !$omp end critical (foo)
36 !ERROR: Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive
37 !$omp critical hint(omp_lock_hint_uncontended)
38 j = j + 1
39 !$omp end critical
41 !$omp critical (foo) hint(omp_lock_hint_uncontended)
42 i = i - 1
43 !$omp end critical (foo)
45 !$omp critical hint(omp_sync_hint_none)
46 j = j + 1
47 !$omp end critical
49 !$omp critical (foo) hint(omp_sync_hint_none)
50 i = i - 1
51 !$omp end critical (foo)
53 end program sample