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
Dead
[official-gcc.git]
/
gomp-20050608-branch
/
libgomp
/
testsuite
/
libgomp.c
/
omp-single-2.c
blob
6878559739751c53c493878688b8b7f859837da0
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
main
()
13
{
14
int
i
=
0
;
15
struct
X x
;
16
int
bad
=
0
;
17
18
#pragma omp parallel private (i, x) shared (bad)
19
{
20
i
=
5
;
21
22
#pragma omp single copyprivate (i, x)
23
{
24
i
++;
25
x
.
a
=
23
;
26
x
.
b
=
42
;
27
x
.
c
=
26
;
28
}
29
30
if
(
i
!=
6
||
x
.
a
!=
23
||
x
.
b
!=
42
||
x
.
c
!=
26
)
31
bad
=
1
;
32
}
33
34
if
(
bad
)
35
abort
();
36
37
return
0
;
38
}