Mercurial > hg > CbC > CbC_gcc
annotate libgomp/testsuite/libgomp.c++/loop-2.C @ 0:a06113de4d67
first commit
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2009 14:47:48 +0900 |
parents | |
children | 84e7813d76e9 |
rev | line source |
---|---|
0 | 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 } |