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 rtl-optimization/77919
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c
/
pr35549.c
blob
269a0c26290c5e9b56c6b180e55277de5a9bc0dc
1
/* PR middle-end/35549 */
2
/* { dg-do run } */
3
4
#include <omp.h>
5
#include <stdlib.h>
6
7
int
8
main
(
void
)
9
{
10
int
i
=
6
,
n
=
0
;
11
omp_set_dynamic
(
0
);
12
omp_set_nested
(
1
);
13
#pragma omp parallel shared (i) num_threads (3)
14
{
15
if
(
omp_get_num_threads
() !=
3
)
16
#pragma omp atomic
17
n
+=
1
;
18
#pragma omp parallel shared (i) num_threads (4)
19
{
20
if
(
omp_get_num_threads
() !=
4
)
21
#pragma omp atomic
22
n
+=
1
;
23
#pragma omp critical
24
i
+=
1
;
25
}
26
}
27
if
(
n
==
0
&&
i
!=
6
+
3
*
4
)
28
abort
();
29
return
0
;
30
}