1 // { dg-options "-fopenmp" }
2 
3 void bar (void *);
4 
5 __attribute__((noinline, noclone)) void
foo(void * qx,void * rx,void * sx,int n)6 foo (void *qx, void *rx, void *sx, int n)
7 {
8   unsigned short (*q)[n], (*r)[n], (*s)[n], (*p)[n];
9   q = (typeof (q)) qx;
10   r = (typeof (r)) rx;
11   s = (typeof (s)) sx;
12   int t = 1;
13   int o = -1;
14   #pragma omp for
15   for (p = q; p != r; p += t)		/* { dg-error "increment is not constant 1 or -1" } */
16     bar (p);
17   #pragma omp for
18   for (p = s; p != r; p += o)		/* { dg-error "increment is not constant 1 or -1" } */
19     bar (p);
20   #pragma omp for
21   for (p = q; p != r; p = p + t)	/* { dg-error "increment is not constant 1 or -1" } */
22     bar (p);
23   #pragma omp for
24   for (p = s; p != r; p = p + o)	/* { dg-error "increment is not constant 1 or -1" } */
25     bar (p);
26   #pragma omp for
27   for (p = q; p != r; p = t + p)	/* { dg-error "increment is not constant 1 or -1" } */
28     bar (p);
29   #pragma omp for
30   for (p = s; p != r; p = o + p)	/* { dg-error "increment is not constant 1 or -1" } */
31     bar (p);
32   #pragma omp for
33   for (p = q; p != r; p += 2)		/* { dg-error "increment is not constant 1 or -1" } */
34     bar (p);
35   #pragma omp for
36   for (p = s; p != r; p -= 2)		/* { dg-error "increment is not constant 1 or -1" } */
37     bar (p);
38   #pragma omp for
39   for (p = q; p != r; p = p + 3)	/* { dg-error "increment is not constant 1 or -1" } */
40     bar (p);
41   #pragma omp for
42   for (p = s; p != r; p = p - 3)	/* { dg-error "increment is not constant 1 or -1" } */
43     bar (p);
44   #pragma omp for
45   for (p = q; p != r; p = 4 + p)	/* { dg-error "increment is not constant 1 or -1" } */
46     bar (p);
47   #pragma omp for
48   for (p = s; p != r; p = -5 + p)	/* { dg-error "increment is not constant 1 or -1" } */
49     bar (p);
50 }
51