repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
sched1: debug/model: dump predecessor list and BB num [NFC]
[gcc.git]
/
libgomp
/
testsuite
/
libgomp.c
/
omp-single-2.c
blob
f16cbbeb1f32338f1b42357656ea9a60537af74e
1
#include <omp.h>
2
3
extern
void
abort
(
void
);
4
5
struct
X
6
{
7
int
a
;
8
char
b
;
9
int
c
;
10
};
11
12
int
13
main
()
14
{
15
int
i
=
0
;
16
struct
X x
;
17
int
bad
=
0
;
18
19
#pragma omp parallel private (i, x) shared (bad)
20
{
21
i
=
5
;
22
23
#pragma omp single copyprivate (i, x)
24
{
25
i
++;
26
x
.
a
=
23
;
27
x
.
b
=
42
;
28
x
.
c
=
26
;
29
}
30
31
if
(
i
!=
6
||
x
.
a
!=
23
||
x
.
b
!=
42
||
x
.
c
!=
26
)
32
bad
=
1
;
33
}
34
35
if
(
bad
)
36
abort
();
37
38
return
0
;
39
}