Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / gcc.dg / gomp / for-1.c
blob80e0d0be844258cf41ee8ea5a4abc069fc216e1f
1 /* { dg-do compile } */
2 /* { dg-options "-fopenmp -fshow-column" } */
4 void baz (int);
6 void foo (int j, int k)
8 int i;
10 /* Valid loops. */
11 #pragma omp for
12 for (i = 0; i < 10; i++)
13 baz (i);
15 #pragma omp for
16 for (i = j; i <= 10; i+=4)
17 baz (i);
19 #pragma omp for
20 for (i = j; i > 0; i = i - 1)
21 baz (j);
23 #pragma omp for
24 for (i = j; i >= k; i--)
25 baz (i);
27 /* Malformed parallel loops. */
28 #pragma omp for
29 i = 0; /* { dg-error "3:for statement expected" } */
30 for ( ; i < 10; )
32 baz (i);
33 i++;
36 #pragma omp for
37 for (i = 0; ; i--) /* { dg-error "missing controlling predicate" } */
39 if (i >= 10)
40 break; /* { dg-error "break" } */
41 baz (i);
44 #pragma omp for
45 for (i = 0; i < 10 && j > 4; i-=3) /* { dg-error "15:invalid controlling predicate" } */
46 baz (i);
48 #pragma omp for
49 for (i = 0; i < 10; i-=3, j+=2) /* { dg-error "27:invalid increment expression" } */
50 baz (i);