Mercurial > hg > CbC > CbC_gcc
annotate libgomp/testsuite/libgomp.c/loop-9.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 |
rev | line source |
---|---|
0 | 1 extern void abort (void); |
2 | |
3 char buf[8] = "01234567"; | |
4 char buf2[8] = "23456789"; | |
5 | |
6 int | |
7 main (void) | |
8 { | |
9 char *p, *q; | |
10 int sum = 0; | |
11 #pragma omp parallel for collapse (2) reduction (+:sum) lastprivate (p, q) | |
12 for (p = buf; p < &buf[8]; p++) | |
13 for (q = &buf2[0]; q <= buf2 + 7; q++) | |
14 sum += (*p - '0') + (*q - '0'); | |
15 if (p != &buf[8] || q != buf2 + 8 || sum != 576) | |
16 abort (); | |
17 return 0; | |
18 } |