Mercurial > hg > CbC > CbC_gcc
annotate libgomp/testsuite/libgomp.c++/loop-5.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 "C" void abort (); |
2 | |
3 int check; | |
4 int f1() { check |= 1; return 1; } | |
5 int f2() { check |= 2; return 11; } | |
6 int f3() { check |= 4; return 2; } | |
7 | |
8 int a[12]; | |
9 | |
10 int main() | |
11 { | |
12 #pragma omp for | |
13 for (int i = f1(); i <= f2(); i += f3()) | |
14 a[i] = 1; | |
15 | |
16 for (int i = 0; i < 12; ++i) | |
17 if (a[i] != (i & 1)) | |
18 abort (); | |
19 } |