2 ! { dg-options "-fno-inline -fno-ipa-sra -fno-ipa-cp -fno-ipa-cp-clone" }
3 ! { dg-set-target-env-var OMP_CANCELLATION "true" }
12 if (omp_get_cancellation ()) call foo (x
)
21 !$omp parallel num_threads (32) shared (v, w)
24 !$omp cancel do if (x(1))
29 !$omp cancel do if (x(2))
36 !$omp cancel do if (x(3))
43 !$omp cancel do if (x(4))
50 if (v
.ne
.3000.or
.w
.ne
.0) STOP 2
51 !$omp parallel num_threads (32) shared (v, w)
52 ! None of these cancel directives should actually cancel anything,
53 ! but the compiler shouldn't know that and thus should use cancellable
54 ! barriers at the end of all the workshares.
55 !$omp cancel parallel if (omp_get_thread_num ().eq.1.and.x(5))
58 !$omp cancel do if (x(1))
61 !$omp cancel parallel if (omp_get_thread_num ().eq.2.and.x(5))
64 !$omp cancel do if (x(2))
69 !$omp cancel parallel if (omp_get_thread_num ().eq.3.and.x(5))
72 !$omp cancel do if (x(3))
77 !$omp cancel parallel if (omp_get_thread_num ().eq.4.and.x(5))
80 !$omp cancel do if (x(4))
86 !$omp cancel parallel if (omp_get_thread_num ().eq.5.and.x(5))
88 if (v
.ne
.6000.or
.w
.ne
.0) STOP 4