Mercurial > hg > CbC > CbC_gcc
annotate libgomp/testsuite/libgomp.c++/cancel-for-1.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run } |
2 // { dg-set-target-env-var OMP_CANCELLATION "true" } | |
3 | |
4 #include <omp.h> | |
5 #include "cancel-test.h" | |
6 | |
7 int | |
8 main () | |
9 { | |
10 { | |
11 S c; | |
12 #pragma omp parallel num_threads (32) | |
13 { | |
14 S a, b; | |
15 int i; | |
16 #pragma omp for private (b) firstprivate (c) | |
17 for (i = 0; i < 1000; ++i) | |
18 { | |
19 S d; | |
20 #pragma omp cancel for | |
21 if (omp_get_cancellation ()) | |
22 abort (); | |
23 b.bump (); | |
24 c.bump (); | |
25 } | |
26 } | |
27 } | |
28 S::verify (); | |
29 } |