]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/c-c++-common/gomp/critical-hint-1.c
7 #pragma omp parallel for
8 for (int i
= 0; i
< 10; ++i
)
10 #pragma omp critical hint(omp_sync_hint_none) /* OK */
12 #pragma omp critical (HASH) hint(omp_sync_hint_none) /* OK */
14 #pragma omp critical (HASH2) hint(omp_sync_hint_uncontended) /* OK */
16 #pragma omp critical (HASH3) hint(omp_sync_hint_contended) /* OK */
18 #pragma omp critical (HASH4) hint(omp_sync_hint_speculative) /* OK */
20 #pragma omp critical (HASH5) hint(omp_sync_hint_nonspeculative) /* OK */
22 #pragma omp critical (HASH6) hint(omp_sync_hint_contended + omp_sync_hint_speculative) /* OK */
24 #pragma omp critical (HASH6) hint(omp_sync_hint_contended | omp_sync_hint_speculative) /* OK */
27 /* Accepted but invalid: different hint for same name. */
28 #pragma omp critical (HASH6) hint(omp_sync_hint_uncontended + omp_sync_hint_speculative)
30 /* Accepted but invalid: Some random integer expr. */
31 #pragma omp critical (HASH) hint(omp_sync_hint_speculative + 1 + 2)
34 #pragma omp critical (HASH) hint(-3) /* { dg-error "expected constant integer expression" } */
36 #pragma omp critical (HASH2) hint(b) /* { dg-error "constant integer expression" } */
39 Fails with gcc as 'expected identifier' and
40 with g++ as "clause requires a name, except when 'omp_sync_hint_none'"
41 #pragma omp critical () hint(omp_sync_hint_speculative)
44 #pragma omp critical hint(omp_sync_hint_speculative) /* { dg-error "with 'hint' clause requires a name, except when 'omp_sync_hint_none' is used" } */