blob: d214d728c3a46f51f41ab9cda22d4f28fbde21d6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
// { dg-do compile { target c++11 } }
#include <vector>
extern void dummy (int);
template<class T, int U1, int U2, int U3> void
test_template ()
{
std::vector<int> v;
for (unsigned i = 0; i < 1000; i++)
v.push_back (i);
#pragma omp for
for (int i : v)
dummy (i);
#pragma omp unroll partial(U1)
for (T i : v)
dummy (i);
#pragma omp unroll partial(U2) // { dg-error "'partial' argument needs positive constant integer expression" }
for (T i : v)
dummy (i);
#pragma omp unroll partial(U3) // { dg-error "'partial' argument needs positive constant integer expression" }
for (T i : v)
dummy (i);
#pragma omp for
#pragma omp unroll partial(U1)
for (T i : v)
dummy (i);
#pragma omp for
#pragma omp unroll partial(U2) // { dg-error "'partial' argument needs positive constant integer expression" }
for (T i : v)
dummy (i);
#pragma omp for
#pragma omp unroll partial(U3) // { dg-error "'partial' argument needs positive constant integer expression" }
for (T i : v)
dummy (i);
}
void
test ()
{
test_template <long, 5,-2, 0> ();
}
|