summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr48632.C
blob: afa8b18933668e845aaff5eca26320df76ccc188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/48632
// { dg-do compile }
// { dg-options "-fopenmp" }

template<typename T>
void
foo (T *x, T *y, unsigned z)
{
#pragma omp parallel for
  for (T *p = x; p < y; p += z)
    ;
#pragma omp parallel for
  for (T *p = y; p > x; p -= z)
    ;
}

int
main ()
{
  char buf[10];
  foo (&buf[0], &buf[9], 1);
}