1 /* { dg-do compile } */
3 /* Tests iterators are allowed in ordered loops and that we keep track
4 of the original iterator DECL for diagnostic purposes. */
9 /* Test plain iterator. */
13 for (int i=1; i<=5; i++) v.push_back(i);
15 std::vector<int>::const_iterator it;
17 #pragma omp parallel for ordered(1)
18 for (it = v.begin(); it < v.end(); ++it)
20 #pragma omp ordered depend(sink:it-1)
21 std::cout << *it << '\n';
22 #pragma omp ordered depend(source)
26 /* Test non-dependent iterator in a template. */
31 for (int i=1; i<=5; i++) v.push_back(i);
33 std::vector<int>::const_iterator it;
34 #pragma omp parallel for ordered(1)
35 for (it = v.begin(); it < v.end(); ++it)
37 #pragma omp ordered depend(sink:it-1)
38 std::cout << *it << '\n';
39 #pragma omp ordered depend(source)
43 /* Test dependent iterator in a template. */
48 for (int i=1; i<=5; i++) v.push_back(i);
50 typename std::vector<T>::const_iterator it;
51 #pragma omp parallel for ordered(1)
52 for (it = v.begin(); it < v.end(); ++it)
54 #pragma omp ordered depend(sink:it-1)
55 std::cout << *it << '\n';
56 #pragma omp ordered depend(source)