1 /* { dg-do compile } */
9 #pragma omp parallel for
10 for (int i
= 0; i
< 10; ++i
)
12 #pragma omp critical hint(omp_sync_hint_none) /* OK */
14 #pragma omp critical (HASH) hint(omp_sync_hint_none) /* OK */
16 #pragma omp critical (HASH2) hint(omp_sync_hint_uncontended) /* OK */
18 #pragma omp critical (HASH3) hint(omp_sync_hint_contended) /* OK */
20 #pragma omp critical (HASH4) hint(omp_sync_hint_speculative) /* OK */
22 #pragma omp critical (HASH5) hint(omp_sync_hint_nonspeculative) /* OK */
24 #pragma omp critical (HASH6) hint(omp_sync_hint_contended + omp_sync_hint_speculative) /* OK */
26 #pragma omp critical (HASH6) hint(omp_sync_hint_contended | omp_sync_hint_speculative) /* OK */
29 /* Accepted but invalid: different hint for same name. */
30 #pragma omp critical (HASH6) hint(omp_sync_hint_uncontended + omp_sync_hint_speculative)
32 /* Accepted but invalid: Some random integer expr. */
33 #pragma omp critical (HASH) hint(omp_sync_hint_speculative + 1 + 2)
36 #pragma omp critical (HASH) hint(-3) /* { dg-error "expected constant integer expression" } */
38 #pragma omp critical (HASH2) hint(b) /* { dg-error "constant integer expression" } */
41 Fails with gcc as 'expected identifier' and
42 with g++ as "clause requires a name, except when 'omp_sync_hint_none'"
43 #pragma omp critical () hint(omp_sync_hint_speculative)
46 #pragma omp critical hint(omp_sync_hint_speculative) /* { dg-error "with 'hint' clause requires a name, except when 'omp_sync_hint_none' is used" } */