1 ! REQUIRES: openmp_runtime
3 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
4 ! Semantic checks on hint clauses, as they appear on critical construct
13 !$omp critical (name) hint(1)
15 !$omp end critical (name)
17 !$omp critical (name) hint(2)
19 !$omp end critical (name)
21 !ERROR: Hint clause value is not a valid OpenMP synchronization value
22 !$omp critical (name) hint(3)
24 !$omp end critical (name)
26 !$omp critical (name) hint(5)
28 !$omp end critical (name)
30 !ERROR: Hint clause value is not a valid OpenMP synchronization value
31 !$omp critical (name) hint(7)
33 !$omp end critical (name)
35 !ERROR: Hint clause must have non-negative constant integer expression
36 !ERROR: Must be a constant value
37 !$omp critical (name) hint(x)
39 !$omp end critical (name)
41 !$omp critical (name) hint(4)
43 !$omp end critical (name)
45 !$omp critical (name) hint(8)
47 !$omp end critical (name)
49 !$omp critical (name) hint(omp_sync_hint_uncontended)
51 !$omp end critical (name)
53 !$omp critical (name) hint(omp_lock_hint_speculative)
55 !$omp end critical (name)
57 !ERROR: Hint clause must have non-negative constant integer expression
58 !ERROR: Must be a constant value
59 !$omp critical (name) hint(omp_sync_hint_uncontended + omp_sync_hint)
61 !$omp end critical (name)
63 !$omp critical (name) hint(omp_sync_hint_nonspeculative)
65 !$omp end critical (name)
67 !$omp critical (name) hint(omp_sync_hint_none)
69 !$omp end critical (name)
71 !$omp critical (name) hint(omp_sync_hint_uncontended + omp_lock_hint_speculative)
73 !$omp end critical (name)
75 !$omp critical (name) hint(omp_lock_hint_nonspeculative + omp_lock_hint_uncontended)
77 !$omp end critical (name)
79 !$omp critical (name) hint(omp_lock_hint_contended + omp_sync_hint_speculative)
81 !$omp end critical (name)
83 !$omp critical (name) hint(omp_lock_hint_contended + omp_sync_hint_nonspeculative)
85 !$omp end critical (name)
87 !ERROR: Hint clause value is not a valid OpenMP synchronization value
88 !$omp critical (name) hint(omp_sync_hint_uncontended + omp_sync_hint_contended)
90 !$omp end critical (name)
92 !ERROR: Hint clause value is not a valid OpenMP synchronization value
93 !$omp critical (name) hint(omp_sync_hint_nonspeculative + omp_lock_hint_speculative)
95 !$omp end critical (name)
97 !ERROR: Hint clause must have non-negative constant integer expression
98 !$omp critical (name) hint(1.0)
100 !$omp end critical (name)
102 !ERROR: Hint clause must have non-negative constant integer expression
103 !ERROR: Operands of + must be numeric; have LOGICAL(4) and INTEGER(4)
104 !$omp critical (name) hint(z + omp_sync_hint_nonspeculative)
106 !$omp end critical (name)
108 !ERROR: Hint clause must have non-negative constant integer expression
109 !ERROR: Must be a constant value
110 !$omp critical (name) hint(k + omp_sync_hint_speculative)
112 !$omp end critical (name)
114 !ERROR: Hint clause must have non-negative constant integer expression
115 !ERROR: Must be a constant value
116 !$omp critical (name) hint(p(1) + omp_sync_hint_uncontended)
118 !$omp end critical (name)