Daily bump.
[official-gcc.git] / libgomp / testsuite / libgomp.c / pr66199-2.c
blob2fc9eec529a09753b6057048edd29513361bfa1f
1 /* PR middle-end/66199 */
2 /* { dg-do run } */
4 #pragma omp declare target
5 int u[1024], v[1024], w[1024];
6 #pragma omp end declare target
8 __attribute__((noinline, noclone)) void
9 f1 (long a, long b)
11 long d;
12 #pragma omp target teams distribute parallel for simd default(none) firstprivate (a, b) shared(u, v, w)
13 for (d = a; d < b; d++)
14 u[d] = v[d] + w[d];
17 __attribute__((noinline, noclone)) void
18 f2 (long a, long b, long c)
20 long d, e;
21 #pragma omp target teams distribute parallel for simd default(none) firstprivate (a, b, c) shared(u, v, w) linear(d) lastprivate(e)
22 for (d = a; d < b; d++)
24 u[d] = v[d] + w[d];
25 e = c + d * 5;
29 __attribute__((noinline, noclone)) void
30 f3 (long a1, long b1, long a2, long b2)
32 long d1, d2;
33 #pragma omp target teams distribute parallel for simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
34 for (d1 = a1; d1 < b1; d1++)
35 for (d2 = a2; d2 < b2; d2++)
36 u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
39 __attribute__((noinline, noclone)) void
40 f4 (long a1, long b1, long a2, long b2)
42 long d1, d2;
43 #pragma omp target teams distribute parallel for simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) collapse(2)
44 for (d1 = a1; d1 < b1; d1++)
45 for (d2 = a2; d2 < b2; d2++)
46 u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
49 int
50 main ()
52 f1 (0, 1024);
53 f2 (0, 1024, 17);
54 f3 (0, 32, 0, 32);
55 f4 (0, 32, 0, 32);
56 return 0;