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
Daily bump.
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c++
/
loop-2.C
blob
77144b8e7c69f82fc4abd586319dca8bdcb585b7
1
#include <omp.h>
2
3
/* Orphaned work sharing. */
4
5
extern "C" void abort (void);
6
7
#define N 10
8
9
void parloop (int *a)
10
{
11
int i;
12
13
#pragma omp for
14
for (i = 0; i < N; i++)
15
a[i] = i + 3;
16
}
17
18
int
19
main()
20
{
21
int i, a[N];
22
23
#pragma omp parallel shared(a)
24
{
25
parloop (a);
26
}
27
28
for (i = 0; i < N; i++)
29
if (a[i] != i + 3)
30
abort ();
31
32
return 0;
33
}