3 subroutine example_criticial ()
6 integer, parameter :: my_omp_hint
= omp_sync_hint_contended
11 !$omp critical (HASH0) hint(my_omp_hint) ! OK
13 !$omp end critical (HASH0)
17 !$omp critical (HASH1) hint(omp_sync_hint_none) ! OK
19 !$omp end critical (HASH1)
23 !$omp critical (HASH2) hint(omp_sync_hint_uncontended) ! OK
25 !$omp end critical (HASH2)
29 !$omp critical (HASH3) hint(omp_sync_hint_contended) ! OK
31 !$omp end critical (HASH3)
35 !$omp critical (HASH4) hint(omp_sync_hint_speculative) ! OK
37 !$omp end critical (HASH4)
41 !$omp critical (HASH5) hint(omp_sync_hint_nonspeculative) ! OK
43 !$omp end critical (HASH5)
47 !$omp critical (HASH6) hint(omp_sync_hint_contended + omp_sync_hint_speculative) ! OK
49 !$omp end critical (HASH6)
54 ! Accepted but invalid: different hint for same name.
55 !$omp critical (HASH6) hint(omp_sync_hint_contended + omp_sync_hint_speculative) ! OK
57 !$omp end critical (HASH6)
61 ! Accepted but invalid: Some random integer expr.
62 !$omp critical (HASH) hint(1 + 2)
64 !$omp end critical (HASH)
68 !$omp critical (HASH) hint(-3) ! { dg-error "shall be a valid constant hint expression" }
70 !$omp end critical (HASH)
74 !$omp critical (HASH2) hint(b) ! { dg-error "shall be a valid constant hint expression" }
76 !$omp end critical (HASH2)
80 !$omp critical () hint(omp_hint_speculative) ! { dg-error "Invalid character in name" }
86 !$omp critical hint(omp_sync_hint_none) ! OK
92 !$omp critical hint(omp_sync_hint_contended) ! { dg-error "CRITICAL at .1. with HINT clause requires a NAME, except when omp_sync_hint_none is used" }