[flang] Update CommandTest for AIX (NFC) (#118403)
[llvm-project.git] / flang / test / Semantics / OpenMP / critical-hint-clause.f90
blob419187fa3bbfb61a8be1b5e9f2a03b665b4243d2
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
6 program sample
7 use omp_lib
8 integer :: y
9 logical :: z
10 real :: k
11 integer :: p(1)
13 !$omp critical (name) hint(1)
14 y = 2
15 !$omp end critical (name)
17 !$omp critical (name) hint(2)
18 y = 2
19 !$omp end critical (name)
21 !ERROR: Hint clause value is not a valid OpenMP synchronization value
22 !$omp critical (name) hint(3)
23 y = 2
24 !$omp end critical (name)
26 !$omp critical (name) hint(5)
27 y = 2
28 !$omp end critical (name)
30 !ERROR: Hint clause value is not a valid OpenMP synchronization value
31 !$omp critical (name) hint(7)
32 y = 2
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)
38 y = 2
39 !$omp end critical (name)
41 !$omp critical (name) hint(4)
42 y = 2
43 !$omp end critical (name)
45 !$omp critical (name) hint(8)
46 y = 2
47 !$omp end critical (name)
49 !$omp critical (name) hint(omp_sync_hint_uncontended)
50 y = 2
51 !$omp end critical (name)
53 !$omp critical (name) hint(omp_lock_hint_speculative)
54 y = 2
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)
60 y = 2
61 !$omp end critical (name)
63 !$omp critical (name) hint(omp_sync_hint_nonspeculative)
64 y = 2
65 !$omp end critical (name)
67 !$omp critical (name) hint(omp_sync_hint_none)
68 y = 2
69 !$omp end critical (name)
71 !$omp critical (name) hint(omp_sync_hint_uncontended + omp_lock_hint_speculative)
72 y = 2
73 !$omp end critical (name)
75 !$omp critical (name) hint(omp_lock_hint_nonspeculative + omp_lock_hint_uncontended)
76 y = 2
77 !$omp end critical (name)
79 !$omp critical (name) hint(omp_lock_hint_contended + omp_sync_hint_speculative)
80 y = 2
81 !$omp end critical (name)
83 !$omp critical (name) hint(omp_lock_hint_contended + omp_sync_hint_nonspeculative)
84 y = 2
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)
89 y = 2
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)
94 y = 2
95 !$omp end critical (name)
97 !ERROR: Hint clause must have non-negative constant integer expression
98 !$omp critical (name) hint(1.0)
99 y = 2
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)
105 y = 2
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)
111 y = 2
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)
117 y = 2
118 !$omp end critical (name)
119 end program