libgomp/testsuite/libgomp.c++/loop-5.C
raw| 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 | } |