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