c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / c-c++-common / gomp / loop-5.c
blobb9b2ad9176774c2f195b1224a675260917052176
1 __attribute__((noipa)) int
2 foo (int *a, int *r3)
4 int r = 0, r2[2] = { 0, 0 }, i;
5 #pragma omp parallel loop default (none) reduction (+:r, r2[:2], r3[:2]) shared (a) lastprivate (i)
6 for (i = 0; i < 1024; i++)
8 r += a[i];
9 r2[0] += a[i];
10 r3[1] += a[i];
12 return r + r2[0] + r3[1] + i;
15 __attribute__((noipa)) int
16 bar (int *a, int *r3)
18 int r = 0, r2[2] = { 0, 0 }, i;
19 #pragma omp target parallel loop default (none) reduction (+:r, r2[0:2], r3[0:2]) shared (a) lastprivate (i)
20 for (i = 0; i < 1024; i++)
22 r += a[i];
23 r2[1] += a[i];
24 r3[0] += a[i];
26 return r + r2[1] + r3[0] + i;
29 __attribute__((noipa)) int
30 baz (int *a, int *r3)
32 int r = 0, r2[2] = { 0, 0 }, i;
33 #pragma omp teams loop default (none) reduction (+:r, r2[0:2], r3[1:1]) shared (a) lastprivate (i)
34 for (i = 0; i < 1024; i++)
36 r += a[i];
37 r2[0] += a[i];
38 r3[1] += a[i];
40 return r + r2[0] + r3[1] + i;
43 __attribute__((noipa)) int
44 qux (int *a, int *r3)
46 int r = 0, r2[2] = { 0, 0 }, i;
47 #pragma omp target teams loop default (none) reduction (+:r, r2[1:1], r3[0:2]) shared (a) lastprivate (i)
48 for (i = 0; i < 1024; i++)
50 r += a[i];
51 r2[1] += a[i];
52 r3[0] += a[i] - 1;
53 r3[1] += a[i];
55 return r + r2[1] + r3[0] + r3[1] + i;