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
* builtins.def (BUILT_IN_SETJMP): Declare as library builtin instead
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c++
/
loop-2.C
blob
ea3dc588afd1a33a35c75077a62abd1eb26db6ea
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
main()
19
{
20
int i, a[N];
21
22
#pragma omp parallel shared(a)
23
{
24
parloop (a);
25
}
26
27
for (i = 0; i < N; i++)
28
if (a[i] != i + 3)
29
abort ();
30
31
return 0;
32
}