Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / gomp / depend-2.C
blobc3f19658c5a98fda64b599d940d34279b09c2546
1 // { dg-do compile }
2 // { dg-options "-fopenmp" }
4 extern int a[][10], a2[][10];
5 int b[10], c[10][2], d[10], e[10], f[10];
6 int b2[10], c2[10][2], d2[10], e2[10], f2[10];
7 int k[10], l[10], m[10], n[10], o;
8 int *p;
9 void bar (void);
10 int t[10];
11 #pragma omp threadprivate (t)
13 template <int N>
14 void
15 foo (int g[3][10], int h[4][8], int i[2][10], int j[][9],
16      int g2[3][10], int h2[4][8], int i2[2][10], int j2[][9])
18   #pragma omp task depend(in: bar[2:5]) // { dg-error "is not a variable" }
19     ;
20   #pragma omp task depend(out: t[2:5])
21     ;
22   #pragma omp task depend(inout: k[0.5:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
23     ;
24   #pragma omp task depend(in: l[:7.5f]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
25     ;
26   #pragma omp task depend(out: m[p:]) // { dg-error "low bound \[^\n\r]* of array section does not have integral type" }
27     ;
28   #pragma omp task depend(inout: n[:p]) // { dg-error "length \[^\n\r]* of array section does not have integral type" }
29     ;
30   #pragma omp task depend(in: o[2:5]) // { dg-error "does not have pointer or array type" }
31     ;
32   #pragma omp task depend(out: a[:][2:4]) // { dg-error "array type length expression must be specified" }
33     ;
34   #pragma omp task depend(inout: b[-1:]) // { dg-error "negative low bound in array section" }
35     ;
36   #pragma omp task depend(inout: c[:-3][1:1]) // { dg-error "negative length in array section" }
37     ;
38   #pragma omp task depend(in: d[11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
39     ;
40   #pragma omp task depend(out: e[:11]) // { dg-error "length \[^\n\r]* above array section size" }
41     ;
42   #pragma omp task depend(out: f[1:10]) // { dg-error "high bound \[^\n\r]* above array section size" }
43     ;
44   #pragma omp task depend(in: g[:][2:4]) // { dg-error "for pointer type length expression must be specified" }
45     ;
46   #pragma omp task depend(in: h[2:2][-1:]) // { dg-error "negative low bound in array section" }
47     ;
48   #pragma omp task depend(inout: h[:1][:-3]) // { dg-error "negative length in array section" }
49     ;
50   #pragma omp task depend(out: i[:1][11:]) // { dg-error "low bound \[^\n\r]* above array section size" }
51     ;
52   #pragma omp task depend(in: j[3:4][:10]) // { dg-error "length \[^\n\r]* above array section size" }
53     ;
54   #pragma omp task depend(out: j[30:10][5:5]) // { dg-error "high bound \[^\n\r]* above array section size" }
55     ;
56   #pragma omp task depend(out: a2[:3][2:4])
57     ;
58   #pragma omp task depend(inout: b2[0:])
59     ;
60   #pragma omp task depend(inout: c2[:3][1:1])
61     ;
62   #pragma omp task depend(in: d2[9:])
63     ;
64   #pragma omp task depend(out: e2[:10])
65     ;
66   #pragma omp task depend(out: f2[1:9])
67     ;
68   #pragma omp task depend(in: g2[:2][2:4])
69     ;
70   #pragma omp task depend(in: h2[2:2][0:])
71     ;
72   #pragma omp task depend(inout: h2[:1][:3])
73     ;
74   #pragma omp task depend(out: i2[:1][9:])
75     ;
76   #pragma omp task depend(in: j2[3:4][:9])
77     ;
78   #pragma omp task depend(out: j2[30:10][5:4])
79     ;
82 void
83 baz (int g[3][10], int h[4][8], int i[2][10], int j[][9],
84      int g2[3][10], int h2[4][8], int i2[2][10], int j2[][9])
86   foo<0> (g, h, i, j, g2, h2, i2, j2);