repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR target/82855
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c
/
cancel-taskgroup-2.c
blob
c7b8bf756237cd470cc8b81a2842e5bbf24b2d33
1
/* { dg-do run } */
2
/* { dg-set-target-env-var OMP_CANCELLATION "true" } */
3
4
#include <stdlib.h>
5
#include <unistd.h>
6
#include <omp.h>
7
8
int
9
main
()
10
{
11
#pragma omp parallel
12
#pragma omp taskgroup
13
#pragma omp task
14
{
15
#pragma omp cancel taskgroup
16
if
(
omp_get_cancellation
())
17
abort
();
18
}
19
#pragma omp parallel
20
{
21
#pragma omp barrier
22
#pragma omp single
23
#pragma omp taskgroup
24
{
25
int
i
;
26
for
(
i
=
0
;
i
<
50
;
i
++)
27
#pragma omp task
28
{
29
#pragma omp cancellation point taskgroup
30
usleep
(
30
);
31
#pragma omp cancel taskgroup if (i > 5)
32
}
33
}
34
usleep
(
10
);
35
}
36
return
0
;
37
}